gloomberb 0.20.12 → 0.20.13
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 +1 -1
- package/src/account/billing.ts +3 -2
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/index.ts +10 -2
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/telemetry.ts +47 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/types/news.ts +16 -0
- package/src/architecture/floating-promise-allowlist.json +17 -33
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/cli/commands/market.ts +51 -32
- package/src/cli/commands/overview.ts +3 -3
- package/src/cli/commands/search.ts +103 -9
- package/src/cli/commands/ticker.ts +22 -13
- package/src/cli/earnings-calendar.ts +33 -53
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +9 -0
- package/src/cli/listing-arg.ts +105 -18
- package/src/cli/pane-functions/catalog.ts +55 -7
- package/src/cli/pane-functions/dom.ts +8 -1
- package/src/cli/pane-functions/freshness.ts +2 -2
- package/src/cli/pane-functions/headless.ts +8 -8
- package/src/cli/pane-functions/index.ts +1 -1
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +6 -2
- package/src/cli/result.ts +2 -1
- package/src/components/chart/composite/axis-overlays.tsx +5 -2
- package/src/components/chart/composite/composite-chart.tsx +1 -0
- package/src/components/chart/composite/format.ts +101 -15
- package/src/components/chart/composite/legend.tsx +60 -25
- package/src/components/chart/composite/time-axis.ts +51 -29
- package/src/components/chart/composite/toolbar.tsx +42 -6
- package/src/components/chart/curve/curve-surface.tsx +5 -5
- package/src/components/command-bar/list/badge.ts +8 -5
- package/src/components/command-bar/list/model.ts +0 -5
- package/src/components/command-bar/list/view.tsx +39 -2
- package/src/components/command-bar/routes/root/plugin-install.ts +4 -2
- package/src/components/command-bar/routes/root/provider-search.ts +23 -3
- package/src/components/command-bar/routes/root/results.ts +20 -9
- package/src/components/command-bar/routes/root/start-here.ts +1 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +2 -3
- package/src/components/command-bar/routes/ticker-search/results.ts +23 -4
- package/src/components/data-table/view.tsx +29 -6
- package/src/components/form-modal/host.tsx +1 -1
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +3 -3
- package/src/components/layout/pane/error-boundary.tsx +2 -1
- package/src/components/markdown-text.tsx +36 -0
- package/src/components/market-board/index.tsx +4 -3
- package/src/components/onboarding/first-run-workspace.ts +46 -11
- package/src/components/onboarding/onboarding-keyboard.ts +57 -5
- package/src/components/onboarding/onboarding-wizard.tsx +91 -24
- package/src/components/onboarding/portfolio-step/index.tsx +1 -0
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +36 -9
- package/src/components/onboarding/portfolio-step/types.ts +2 -0
- package/src/components/onboarding/tickers-step-model.ts +140 -0
- package/src/components/onboarding/tickers-step.tsx +116 -0
- package/src/components/onboarding/use-onboarding-broker-form.ts +1 -1
- package/src/components/onboarding/use-onboarding-progress.ts +100 -11
- package/src/components/onboarding/use-onboarding-upgrade.ts +3 -2
- package/src/components/onboarding/wizard-model.ts +3 -1
- package/src/components/onboarding/wizard-tickers.ts +139 -0
- package/src/components/price-performance.tsx +2 -2
- package/src/components/speedometer-gauge/model.ts +2 -1
- package/src/components/speedometer-gauge/terminal.tsx +13 -8
- package/src/components/ui/choice-dialog.tsx +101 -32
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/query-bar.tsx +16 -4
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +1 -1
- package/src/i18n/es.ts +5 -2
- package/src/i18n/ja.ts +5 -2
- package/src/i18n/ko.ts +5 -2
- package/src/i18n/zh-cn.ts +5 -2
- package/src/i18n/zh-tw.ts +5 -2
- package/src/layout-marketplace/model.ts +2 -1
- package/src/market-data/futures-contract.ts +2 -1
- package/src/market-data/hooks.tsx +1 -1
- package/src/market-data/market/change-basis.ts +27 -5
- package/src/market-data/market/format.ts +13 -13
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/time.ts +17 -10
- package/src/market-data/tax-equivalent.ts +3 -2
- package/src/news/aggregator.ts +19 -8
- package/src/news/hooks.ts +1 -1
- package/src/news/news-model.ts +49 -0
- package/src/news/types.ts +9 -0
- package/src/plugins/builtin/account-management/calendar-tab.tsx +8 -3
- package/src/plugins/builtin/account-management/pane.tsx +9 -8
- package/src/plugins/builtin/alerts/calendar-events.ts +4 -5
- package/src/plugins/builtin/alerts/format.ts +6 -5
- package/src/plugins/builtin/alerts/headless.ts +3 -2
- package/src/plugins/builtin/alerts/history.ts +2 -1
- package/src/plugins/builtin/alerts/pane.tsx +2 -1
- package/src/plugins/builtin/alerts/price-text.ts +2 -1
- package/src/plugins/builtin/alerts/scheduled.ts +6 -5
- package/src/plugins/builtin/analytics/account-returns.ts +6 -7
- package/src/plugins/builtin/analytics/display.ts +2 -1
- package/src/plugins/builtin/analytics/pane-model.ts +5 -9
- package/src/plugins/builtin/analytics/risk-model.ts +6 -6
- package/src/plugins/builtin/analytics/risk-pane.tsx +6 -5
- package/src/plugins/builtin/analytics/view.tsx +5 -5
- package/src/plugins/builtin/attention/model.ts +6 -5
- package/src/plugins/builtin/attention/pane.tsx +5 -4
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +8 -7
- package/src/plugins/builtin/awards/model.ts +4 -3
- package/src/plugins/builtin/awards/pane.tsx +4 -4
- package/src/plugins/builtin/backtest/format.ts +3 -2
- package/src/plugins/builtin/backtest/report.ts +3 -2
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/add-flow.tsx +1 -1
- package/src/plugins/builtin/broker-trading/orders-data.ts +3 -3
- package/src/plugins/builtin/broker-trading/orders.tsx +3 -2
- package/src/plugins/builtin/broker-trading/ticket.tsx +2 -2
- package/src/plugins/builtin/buildout/cells.tsx +2 -1
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -3
- package/src/plugins/builtin/buildout/data-runtime.ts +21 -23
- package/src/plugins/builtin/buildout/detail/values.ts +2 -1
- package/src/plugins/builtin/buildout/format.ts +4 -3
- package/src/plugins/builtin/buildout/pane/index.tsx +3 -3
- package/src/plugins/builtin/catalysts/detail.tsx +2 -1
- package/src/plugins/builtin/catalysts/model.ts +6 -5
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +3 -2
- package/src/plugins/builtin/cds/model.ts +8 -8
- package/src/plugins/builtin/cds/pane.tsx +3 -2
- package/src/plugins/builtin/central-bank-rates/headless.ts +2 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +3 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -5
- package/src/plugins/builtin/changelog/index.tsx +2 -2
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +7 -3
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +3 -1
- package/src/plugins/builtin/chart-composer/user-series.ts +3 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +2 -1
- package/src/plugins/builtin/chat/controller/utils.ts +2 -1
- package/src/plugins/builtin/clinical-trials/model.ts +4 -3
- package/src/plugins/builtin/clinical-trials/sponsor-tickers.ts +4 -2
- package/src/plugins/builtin/cloud/askg/lock-note.ts +16 -4
- package/src/plugins/builtin/cloud/askg/model.ts +2 -1
- package/src/plugins/builtin/cloud/askg/pane.tsx +35 -1
- package/src/plugins/builtin/cloud/company-picker.tsx +1 -3
- package/src/plugins/builtin/cloud/team/pane.tsx +12 -12
- package/src/plugins/builtin/cloud/thesis/detail.tsx +13 -8
- package/src/plugins/builtin/cloud-tweets/model.ts +2 -2
- package/src/plugins/builtin/comment-letters/pane.tsx +2 -1
- package/src/plugins/builtin/commodity-balances/headless.ts +3 -2
- package/src/plugins/builtin/company-attention/app-rank.tsx +5 -4
- package/src/plugins/builtin/company-attention/building-model.ts +7 -7
- package/src/plugins/builtin/company-attention/headless.ts +6 -5
- package/src/plugins/builtin/company-attention/model.ts +4 -4
- package/src/plugins/builtin/company-attention/moves-model.ts +9 -9
- package/src/plugins/builtin/company-attention/signals-model.ts +9 -9
- package/src/plugins/builtin/company-kpis/headless.ts +2 -1
- package/src/plugins/builtin/company-kpis/model.ts +15 -10
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -2
- package/src/plugins/builtin/congress-trades/detail.tsx +6 -5
- package/src/plugins/builtin/congress-trades/headless.ts +2 -1
- package/src/plugins/builtin/congress-trades/model.ts +6 -6
- package/src/plugins/builtin/congress-trades/table.tsx +7 -6
- package/src/plugins/builtin/connections/pane.tsx +5 -5
- package/src/plugins/builtin/correlation/headless.ts +2 -2
- package/src/plugins/builtin/correlation/index.tsx +4 -1
- package/src/plugins/builtin/correlation/matrix/selection.ts +2 -1
- package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -3
- package/src/plugins/builtin/cot/headless.ts +3 -2
- package/src/plugins/builtin/cot/model.ts +2 -1
- package/src/plugins/builtin/cot/pane.tsx +4 -3
- package/src/plugins/builtin/cpi/headless.ts +4 -3
- package/src/plugins/builtin/cpi/model.ts +8 -7
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +5 -4
- package/src/plugins/builtin/credit-boards/headless.ts +2 -1
- package/src/plugins/builtin/credit-boards/model.ts +5 -5
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/index.tsx +2 -2
- package/src/plugins/builtin/credit-documents/model.ts +2 -2
- package/src/plugins/builtin/crypto-board/defi-view.tsx +7 -7
- package/src/plugins/builtin/crypto-board/defi.ts +2 -2
- package/src/plugins/builtin/crypto-board/model.ts +4 -3
- package/src/plugins/builtin/crypto-board/pane.tsx +8 -8
- package/src/plugins/builtin/crypto-board/supply.ts +2 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +4 -4
- package/src/plugins/builtin/custom-view/index.tsx +3 -1
- package/src/plugins/builtin/custom-view/pane.tsx +5 -1
- package/src/plugins/builtin/custom-view/view-spec.ts +11 -0
- package/src/plugins/builtin/debt-maturities/model.ts +3 -3
- package/src/plugins/builtin/debt-maturities/pane.tsx +2 -2
- package/src/plugins/builtin/dividend-yield/client.ts +7 -3
- package/src/plugins/builtin/dividend-yield/headless.ts +16 -11
- package/src/plugins/builtin/dividend-yield/pane.tsx +12 -10
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +4 -1
- package/src/plugins/builtin/dividend-yield/ranking.ts +19 -11
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +3 -3
- package/src/plugins/builtin/docs/use-docs.ts +4 -2
- package/src/plugins/builtin/doe/headless.ts +2 -1
- package/src/plugins/builtin/doe/model.ts +12 -11
- package/src/plugins/builtin/earnings/board-model.ts +14 -8
- package/src/plugins/builtin/earnings/board-table.ts +13 -8
- package/src/plugins/builtin/earnings/calendar-model.ts +5 -5
- package/src/plugins/builtin/earnings/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings/format.ts +16 -14
- package/src/plugins/builtin/earnings/headless.ts +57 -19
- package/src/plugins/builtin/earnings/history-model.ts +11 -7
- package/src/plugins/builtin/earnings/history-table.ts +14 -9
- package/src/plugins/builtin/earnings/history.tsx +4 -3
- package/src/plugins/builtin/earnings-calls/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings-calls/format.ts +6 -5
- package/src/plugins/builtin/earnings-calls/upcoming.ts +5 -5
- package/src/plugins/builtin/earnings-ripple/headless.ts +2 -1
- package/src/plugins/builtin/earnings-ripple/model.ts +3 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +6 -6
- package/src/plugins/builtin/econ/calendar-model.ts +2 -2
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/index.tsx +7 -6
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -1
- package/src/plugins/builtin/econ-statistics/headless.ts +4 -4
- package/src/plugins/builtin/econ-statistics/pane.tsx +2 -2
- package/src/plugins/builtin/equity-screener/headless.ts +5 -5
- package/src/plugins/builtin/equity-screener/model.ts +6 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +7 -7
- package/src/plugins/builtin/equity-screener/screen-check.ts +2 -1
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
- package/src/plugins/builtin/estimate-revisions/model.ts +3 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +8 -8
- package/src/plugins/builtin/executives/format.ts +4 -4
- package/src/plugins/builtin/exposure/headless.ts +8 -8
- package/src/plugins/builtin/exposure/model.ts +4 -3
- package/src/plugins/builtin/exposure/pane.tsx +6 -5
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/headless.ts +2 -1
- package/src/plugins/builtin/filing-events/feed.ts +2 -1
- package/src/plugins/builtin/futures/table.tsx +8 -8
- package/src/plugins/builtin/futures-curve/headless.ts +18 -18
- package/src/plugins/builtin/futures-curve/model.ts +5 -5
- package/src/plugins/builtin/futures-curve/pane.tsx +8 -8
- package/src/plugins/builtin/fx-matrix/index.tsx +2 -2
- package/src/plugins/builtin/fx-matrix/pairs.ts +2 -1
- package/src/plugins/builtin/gpu/board.tsx +6 -5
- package/src/plugins/builtin/gpu/changes.tsx +2 -1
- package/src/plugins/builtin/gpu/equities.tsx +2 -2
- package/src/plugins/builtin/gpu/headless.ts +4 -3
- package/src/plugins/builtin/gpu/model.ts +8 -7
- package/src/plugins/builtin/help/functions-table.tsx +41 -9
- package/src/plugins/builtin/help/index.tsx +6 -3
- package/src/plugins/builtin/help/keybindings-editor.tsx +35 -7
- package/src/plugins/builtin/help/shortcut-table.tsx +19 -7
- package/src/plugins/builtin/help/table-cells.tsx +51 -0
- package/src/plugins/builtin/holders/pane.tsx +4 -1
- package/src/plugins/builtin/insider/base-values.ts +2 -2
- package/src/plugins/builtin/insider/display.ts +2 -1
- package/src/plugins/builtin/insider/headless.ts +16 -16
- package/src/plugins/builtin/insider/insider-data.ts +2 -1
- package/src/plugins/builtin/insider/signals-model.ts +3 -3
- package/src/plugins/builtin/insider/table-model.ts +27 -13
- package/src/plugins/builtin/insider/table.tsx +1 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +4 -4
- package/src/plugins/builtin/iv-history/format.ts +8 -7
- package/src/plugins/builtin/iv-history/headless.ts +9 -8
- package/src/plugins/builtin/iv-history/pane.tsx +3 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +5 -4
- package/src/plugins/builtin/jobs/headless.ts +11 -11
- package/src/plugins/builtin/jobs/model.ts +2 -2
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/jodi/model.ts +2 -2
- package/src/plugins/builtin/jodi/pane.tsx +2 -1
- package/src/plugins/builtin/kelly-sizer/headless.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/model.ts +2 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -2
- package/src/plugins/builtin/macro-day/headless.ts +6 -5
- package/src/plugins/builtin/macro-day/model.ts +2 -1
- package/src/plugins/builtin/macro-day/pane.tsx +4 -4
- package/src/plugins/builtin/market-halts/model.ts +11 -10
- package/src/plugins/builtin/market-halts/pane.tsx +2 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +4 -4
- package/src/plugins/builtin/market-movers/session-table.ts +3 -3
- package/src/plugins/builtin/market-movers/session.ts +2 -1
- package/src/plugins/builtin/market-movers/table.ts +5 -5
- package/src/plugins/builtin/market-valuation/detail.tsx +2 -2
- package/src/plugins/builtin/market-valuation/headless.ts +7 -7
- package/src/plugins/builtin/market-valuation/pane.tsx +7 -7
- package/src/plugins/builtin/members/breadth-pane.tsx +5 -4
- package/src/plugins/builtin/members/headless.ts +2 -1
- package/src/plugins/builtin/members/model.ts +3 -2
- package/src/plugins/builtin/members/pane.tsx +10 -9
- package/src/plugins/builtin/mna/distress/model.ts +2 -1
- package/src/plugins/builtin/mna/model.ts +5 -5
- package/src/plugins/builtin/money-markets/headless.ts +2 -1
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +4 -4
- package/src/plugins/builtin/news/headless.ts +5 -2
- package/src/plugins/builtin/news/wire/breaking/notifications.ts +21 -19
- package/src/plugins/builtin/news/wire/news/row.ts +3 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +3 -2
- package/src/plugins/builtin/news/wire/persisted-articles.ts +28 -3
- package/src/plugins/builtin/notes/headless.ts +2 -1
- package/src/plugins/builtin/notes/model.ts +2 -1
- package/src/plugins/builtin/openfda/pane.tsx +4 -3
- package/src/plugins/builtin/options/carry.ts +3 -2
- package/src/plugins/builtin/options/market-reference.ts +2 -1
- package/src/plugins/builtin/options/table.ts +48 -9
- package/src/plugins/builtin/options/view.tsx +47 -17
- package/src/plugins/builtin/options-calculator/headless.ts +3 -2
- package/src/plugins/builtin/options-calculator/pane.tsx +7 -7
- package/src/plugins/builtin/options-positioning/headless.ts +8 -7
- package/src/plugins/builtin/options-positioning/model.ts +10 -10
- package/src/plugins/builtin/options-positioning/pane.tsx +5 -5
- package/src/plugins/builtin/options-scenario/collar.ts +5 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +11 -10
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +15 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +2 -1
- package/src/plugins/builtin/options-scenario/csp.ts +6 -5
- package/src/plugins/builtin/options-scenario/headless.ts +6 -5
- package/src/plugins/builtin/options-scenario/hedge.ts +3 -3
- package/src/plugins/builtin/options-scenario/pane.tsx +7 -6
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +1 -1
- package/src/plugins/builtin/pe-band/headless.ts +9 -8
- package/src/plugins/builtin/pe-band/pane.tsx +7 -7
- package/src/plugins/builtin/perps/cascade.ts +3 -2
- package/src/plugins/builtin/perps/headless.ts +10 -9
- package/src/plugins/builtin/perps/model.ts +14 -14
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/index.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/pane/futures-terms.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +2 -1
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +4 -4
- package/src/plugins/builtin/power/detail.tsx +6 -5
- package/src/plugins/builtin/power/gas-model.ts +8 -7
- package/src/plugins/builtin/power/gas.tsx +2 -1
- package/src/plugins/builtin/power/headless.ts +7 -6
- package/src/plugins/builtin/power/model.ts +3 -2
- package/src/plugins/builtin/power/prices-headless.ts +10 -9
- package/src/plugins/builtin/power/prices-model.ts +3 -2
- package/src/plugins/builtin/power/prices.tsx +2 -1
- package/src/plugins/builtin/primary-dealers/model.ts +3 -3
- package/src/plugins/builtin/primary-dealers/pane.tsx +2 -2
- package/src/plugins/builtin/rate-path/headless.ts +8 -7
- package/src/plugins/builtin/rate-path/model.ts +6 -5
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +2 -1
- package/src/plugins/builtin/realized-vol/headless.ts +11 -10
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/relative-rotation/pane.tsx +6 -6
- package/src/plugins/builtin/research/analyst-headless.ts +5 -5
- package/src/plugins/builtin/research/analyst-model.ts +7 -7
- package/src/plugins/builtin/research/analyst-pane.tsx +7 -7
- package/src/plugins/builtin/research/client.ts +14 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +40 -30
- package/src/plugins/builtin/research/event-model.ts +55 -22
- package/src/plugins/builtin/research/event-sources.ts +26 -8
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -12
- package/src/plugins/builtin/research/relative-valuation-currency.ts +16 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +33 -21
- package/src/plugins/builtin/research/relative-valuation-model.ts +31 -17
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +29 -14
- package/src/plugins/builtin/research-search/model.ts +2 -1
- package/src/plugins/builtin/research-search/saved-view.tsx +4 -3
- package/src/plugins/builtin/revenue-breakdown/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +7 -7
- package/src/plugins/builtin/reverse-dcf/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-model.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/headless.ts +3 -2
- package/src/plugins/builtin/scanner/hilo-model.ts +2 -1
- package/src/plugins/builtin/scanner/live-headless.ts +2 -2
- package/src/plugins/builtin/scanner/live-model.ts +3 -2
- package/src/plugins/builtin/scanner/live-pane.tsx +5 -5
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/seasonality/pane.tsx +4 -3
- package/src/plugins/builtin/sec/filing-display.tsx +12 -15
- package/src/plugins/builtin/sec/fund-facts.ts +2 -2
- package/src/plugins/builtin/sec/headless.ts +2 -1
- package/src/plugins/builtin/sec/index.tsx +6 -2
- package/src/plugins/builtin/sectors/headless.ts +4 -4
- package/src/plugins/builtin/sectors/index.tsx +7 -7
- package/src/plugins/builtin/shared/earnings-calendar.ts +90 -6
- package/src/plugins/builtin/shared/earnings-report.ts +13 -6
- package/src/plugins/builtin/shared/research-cells.tsx +2 -2
- package/src/plugins/builtin/shared/source-footer.ts +2 -1
- package/src/plugins/builtin/shared/trend.ts +2 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +9 -8
- package/src/plugins/builtin/short-interest/headless.ts +6 -6
- package/src/plugins/builtin/short-interest/model.ts +9 -9
- package/src/plugins/builtin/short-interest/publications-model.ts +5 -5
- package/src/plugins/builtin/short-interest/publications-pane.tsx +3 -2
- package/src/plugins/builtin/short-interest/watch-headless.ts +5 -5
- package/src/plugins/builtin/short-interest/watch-pane.tsx +6 -6
- package/src/plugins/builtin/short-volume/model.ts +5 -5
- package/src/plugins/builtin/short-volume/pane.tsx +4 -4
- package/src/plugins/builtin/social-mentions/headless.ts +2 -1
- package/src/plugins/builtin/social-mentions/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/graph-model.ts +2 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/headless.ts +3 -2
- package/src/plugins/builtin/supply-chain/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +2 -1
- package/src/plugins/builtin/themes/headless.ts +2 -1
- package/src/plugins/builtin/themes/model.ts +3 -2
- package/src/plugins/builtin/themes/pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/format.ts +9 -9
- package/src/plugins/builtin/thirteenf/headless.ts +3 -2
- package/src/plugins/builtin/thirteenf/model.ts +2 -1
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +2 -1
- package/src/plugins/builtin/thirteenf/pane.tsx +5 -4
- package/src/plugins/builtin/thirteenf/report-notes.ts +2 -1
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/table.ts +6 -5
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -3
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/model.ts +83 -35
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -1
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +2 -2
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +14 -18
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +8 -13
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -5
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/overview/model.ts +24 -13
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +6 -0
- package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +2 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +33 -7
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +7 -5
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +4 -4
- package/src/plugins/builtin/ticker-detail/settings.ts +17 -0
- package/src/plugins/builtin/time-sales/headless.ts +3 -2
- package/src/plugins/builtin/time-sales/model.ts +7 -5
- package/src/plugins/builtin/time-sales/pane.tsx +7 -6
- package/src/plugins/builtin/trace-bonds/model.ts +3 -2
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/client.ts +2 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +6 -6
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +3 -2
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +10 -9
- package/src/plugins/builtin/treasury-auctions/hk.ts +5 -5
- package/src/plugins/builtin/treasury-auctions/model.ts +4 -4
- package/src/plugins/builtin/treasury-auctions/pane.tsx +18 -18
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -1
- package/src/plugins/builtin/treasury-daily/model.ts +2 -2
- package/src/plugins/builtin/vol-surface/events.ts +5 -4
- package/src/plugins/builtin/vol-surface/headless.ts +19 -18
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/pane.tsx +8 -7
- package/src/plugins/builtin/vol-surface/stored.ts +2 -1
- package/src/plugins/builtin/vol-surface/tables.ts +4 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -4
- package/src/plugins/builtin/volatility/pane.tsx +6 -6
- package/src/plugins/builtin/world-indices/headless.ts +7 -7
- package/src/plugins/builtin/world-indices/index.tsx +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +2 -1
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +2 -1
- package/src/plugins/builtin/world-venue-map/layers.ts +3 -2
- package/src/plugins/builtin/world-venue-map/use-geo.ts +4 -2
- package/src/plugins/builtin/yield-curve/curves.ts +3 -3
- package/src/plugins/builtin/yield-curve/headless.ts +7 -6
- package/src/plugins/builtin/yield-curve/index.tsx +5 -4
- package/src/plugins/builtin/yield-curve/swaps.tsx +2 -1
- package/src/portfolio/allocation.ts +5 -5
- package/src/portfolio/column-values.ts +47 -41
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/opentui/ui-host.tsx +32 -2
- package/src/renderers/share/layout-view.tsx +2 -1
- package/src/sources/gloomberb-cloud/news.ts +9 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +2 -0
- package/src/sources/provider-router/search.ts +15 -10
- package/src/state/hooks/inline-tickers.ts +3 -2
- package/src/state/hooks/quote-streaming.ts +9 -10
- package/src/team/collections-sync.ts +8 -3
- package/src/telemetry/usage-counts.ts +26 -0
- package/src/tickers/company-name-listing.ts +2 -2
- package/src/tickers/company-name.ts +17 -1
- package/src/tickers/listing-venues.ts +26 -1
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/index.ts +19 -0
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/time-series/fundamentals/statement-fields.ts +11 -14
- package/src/time-series/history-acquisition.ts +1 -1
- package/src/time-series/log-scale.ts +9 -0
- package/src/time-series/reporting.ts +3 -3
- package/src/time-series/resolve.ts +6 -4
- package/src/time-series/transforms.ts +10 -5
- package/src/types/config.ts +9 -0
- package/src/types/data-provider.ts +3 -2
- package/src/types/financials.ts +15 -0
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-panes.ts +1 -1
- package/src/types/plugin-reports.ts +8 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/financial-statements.ts +39 -15
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/growth.ts +67 -0
- package/src/utils/keyboard.ts +6 -0
- package/src/utils/options.ts +1 -1
- package/src/utils/report-timing.ts +2 -2
- package/src/utils/served-rates.ts +45 -0
- package/src/utils/text-wrap.ts +84 -3
- package/src/utils/zoned-date-time.ts +47 -22
package/src/i18n/ko.ts
CHANGED
|
@@ -494,7 +494,6 @@ export const ko: Record<string, string> = {
|
|
|
494
494
|
"Portfolios Only": "포트폴리오만",
|
|
495
495
|
"Watchlists Only": "관심 목록만",
|
|
496
496
|
"Custom Selection": "맞춤 선택",
|
|
497
|
-
"Collection Pane": "컬렉션 패널",
|
|
498
497
|
"Hide Cash Positions": "현금 포지션 숨기기",
|
|
499
498
|
"Hide Header Bar": "헤더 표시줄 숨기기",
|
|
500
499
|
"Hide Header": "헤더 숨기기",
|
|
@@ -519,7 +518,8 @@ export const ko: Record<string, string> = {
|
|
|
519
518
|
"Functions": "기능",
|
|
520
519
|
"Shortcuts": "단축키",
|
|
521
520
|
"Issues": "이슈",
|
|
522
|
-
"Portfolio
|
|
521
|
+
"Portfolio Settings": "포트폴리오 설정",
|
|
522
|
+
"Watchlist Settings": "관심 목록 설정",
|
|
523
523
|
"Quote Monitor Settings": "시세 모니터 설정",
|
|
524
524
|
"Chart Pane Settings": "차트 패널 설정",
|
|
525
525
|
"Graph Pane Settings": "그래프 패널 설정",
|
|
@@ -1568,6 +1568,9 @@ export const ko: Record<string, string> = {
|
|
|
1568
1568
|
"Pick up to 3; each adds a ready-made tab.": "최대 3개까지 고르세요. 각각 준비된 탭을 추가합니다.",
|
|
1569
1569
|
"Everything else is one search away.": "나머지는 검색 한 번이면 됩니다.",
|
|
1570
1570
|
"DESKS": "데스크",
|
|
1571
|
+
"TICKERS": "종목",
|
|
1572
|
+
"Which tickers do you follow?": "어떤 종목을 팔로우하시나요?",
|
|
1573
|
+
"Pick up to 3 for your watchlist.": "관심 목록에 넣을 종목을 최대 3개까지 고르세요.",
|
|
1571
1574
|
"Skip": "건너뛰기",
|
|
1572
1575
|
"Equities": "주식",
|
|
1573
1576
|
"Futures & commodities": "선물 및 원자재",
|
package/src/i18n/zh-cn.ts
CHANGED
|
@@ -496,7 +496,6 @@ export const zhCN: Record<string, string> = {
|
|
|
496
496
|
"Portfolios Only": "仅投资组合",
|
|
497
497
|
"Watchlists Only": "仅自选列表",
|
|
498
498
|
"Custom Selection": "自定义选择",
|
|
499
|
-
"Collection Pane": "集合面板",
|
|
500
499
|
"Hide Cash Positions": "隐藏现金持仓",
|
|
501
500
|
"Hide Header Bar": "隐藏标题栏",
|
|
502
501
|
"Hide Header": "隐藏标题",
|
|
@@ -521,7 +520,8 @@ export const zhCN: Record<string, string> = {
|
|
|
521
520
|
"Functions": "功能",
|
|
522
521
|
"Shortcuts": "快捷键",
|
|
523
522
|
"Issues": "问题反馈",
|
|
524
|
-
"Portfolio
|
|
523
|
+
"Portfolio Settings": "投资组合设置",
|
|
524
|
+
"Watchlist Settings": "自选列表设置",
|
|
525
525
|
"Quote Monitor Settings": "行情监控设置",
|
|
526
526
|
"Chart Pane Settings": "图表面板设置",
|
|
527
527
|
"Graph Pane Settings": "图形面板设置",
|
|
@@ -1570,6 +1570,9 @@ export const zhCN: Record<string, string> = {
|
|
|
1570
1570
|
"Pick up to 3; each adds a ready-made tab.": "最多选 3 项,每项添加一个现成的标签页。",
|
|
1571
1571
|
"Everything else is one search away.": "其他内容一搜即得。",
|
|
1572
1572
|
"DESKS": "交易台",
|
|
1573
|
+
"TICKERS": "标的",
|
|
1574
|
+
"Which tickers do you follow?": "你关注哪些标的?",
|
|
1575
|
+
"Pick up to 3 for your watchlist.": "最多选 3 个加入自选列表。",
|
|
1573
1576
|
"Skip": "跳过",
|
|
1574
1577
|
"Equities": "股票",
|
|
1575
1578
|
"Futures & commodities": "期货与大宗商品",
|
package/src/i18n/zh-tw.ts
CHANGED
|
@@ -496,7 +496,6 @@ export const zhTW: Record<string, string> = {
|
|
|
496
496
|
"Portfolios Only": "僅投資組合",
|
|
497
497
|
"Watchlists Only": "僅自選清單",
|
|
498
498
|
"Custom Selection": "自訂選擇",
|
|
499
|
-
"Collection Pane": "清單面板",
|
|
500
499
|
"Hide Cash Positions": "隱藏現金持倉",
|
|
501
500
|
"Hide Header Bar": "隱藏標題欄",
|
|
502
501
|
"Hide Header": "隱藏標題",
|
|
@@ -521,7 +520,8 @@ export const zhTW: Record<string, string> = {
|
|
|
521
520
|
"Functions": "功能",
|
|
522
521
|
"Shortcuts": "快速鍵",
|
|
523
522
|
"Issues": "問題回報",
|
|
524
|
-
"Portfolio
|
|
523
|
+
"Portfolio Settings": "投資組合設定",
|
|
524
|
+
"Watchlist Settings": "自選清單設定",
|
|
525
525
|
"Quote Monitor Settings": "行情監控設定",
|
|
526
526
|
"Chart Pane Settings": "圖表面板設定",
|
|
527
527
|
"Graph Pane Settings": "圖形面板設定",
|
|
@@ -1570,6 +1570,9 @@ export const zhTW: Record<string, string> = {
|
|
|
1570
1570
|
"Pick up to 3; each adds a ready-made tab.": "最多選 3 項,每項新增一個現成的分頁。",
|
|
1571
1571
|
"Everything else is one search away.": "其他內容一搜即得。",
|
|
1572
1572
|
"DESKS": "交易台",
|
|
1573
|
+
"TICKERS": "標的",
|
|
1574
|
+
"Which tickers do you follow?": "你關注哪些標的?",
|
|
1575
|
+
"Pick up to 3 for your watchlist.": "最多選 3 個加入自選清單。",
|
|
1573
1576
|
"Skip": "略過",
|
|
1574
1577
|
"Equities": "股票",
|
|
1575
1578
|
"Futures & commodities": "期貨與大宗商品",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { formatShortDate } from "../utils/datetime-format";
|
|
1
2
|
import {
|
|
2
3
|
findPaneInstance,
|
|
3
4
|
type LayoutConfig,
|
|
@@ -169,7 +170,7 @@ function marketplaceAuthorLabel(author: LayoutMarketplaceEntry["author"]): strin
|
|
|
169
170
|
export function formatPublishedAt(iso: string): string {
|
|
170
171
|
const date = new Date(iso);
|
|
171
172
|
if (Number.isNaN(date.getTime())) return "";
|
|
172
|
-
return date
|
|
173
|
+
return formatShortDate(date);
|
|
173
174
|
}
|
|
174
175
|
|
|
175
176
|
export function buildOwnedEntries(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../utils/format";
|
|
1
2
|
import { apiClient } from "../api-client";
|
|
2
3
|
import type { FuturesContractSpec, FuturesContractTermsPayload } from "../api-client/futures-curve";
|
|
3
4
|
import { classifyInstrumentType } from "../tickers/instrument-kind";
|
|
@@ -20,7 +21,7 @@ import { deliveryMonthLabel } from "../utils/contract-month";
|
|
|
20
21
|
*/
|
|
21
22
|
|
|
22
23
|
/** A settlement the exchange has not confirmed reads as CTM writes a missing price. */
|
|
23
|
-
const FUTURES_MISSING =
|
|
24
|
+
const FUTURES_MISSING = MISSING_VALUE;
|
|
24
25
|
|
|
25
26
|
type FuturesContractLineKey = "contract" | "unit" | "size" | "tick" | "pointValue" | "settlement" | "firstNotice" | "lastTrade"
|
|
26
27
|
| "roll" | "front" | "nearest" | "mostActive";
|
|
@@ -660,7 +660,7 @@ export function useFxRateObservations(currencies: Array<string | null | undefine
|
|
|
660
660
|
if (!coordinator) return;
|
|
661
661
|
for (const currency of normalizedCurrencies) {
|
|
662
662
|
if (currency === "USD") continue;
|
|
663
|
-
void coordinator.loadFxRate(currency);
|
|
663
|
+
void coordinator.loadFxRate(currency).catch(logFailure("market-data.hooks", "Loading an exchange rate failed"));
|
|
664
664
|
}
|
|
665
665
|
}, [normalizedCurrencyKey]);
|
|
666
666
|
|
|
@@ -140,21 +140,43 @@ function isCboeYieldIndex(quote: Quote): boolean {
|
|
|
140
140
|
* its published calendar has a session that day and the print came after it
|
|
141
141
|
* opened. The S&P 500's closing print at 16:37 New York on Fri 6 Nov 2026 is
|
|
142
142
|
* Friday's, so its move is from Thursday's close. A print before the day's
|
|
143
|
-
* open, on a day the calendar has no session for,
|
|
144
|
-
* published calendar,
|
|
145
|
-
*
|
|
143
|
+
* open, or on a day the calendar has no session for, names none. An index
|
|
144
|
+
* on a venue with no published calendar, or on Cboe's, whose days are Cboe's
|
|
145
|
+
* own, is dated by its own sessions (`ownIndexSession`); a Cboe yield index,
|
|
146
|
+
* which skips the bond market's holidays, by none.
|
|
146
147
|
*/
|
|
147
148
|
function indexPrintSession(quote: Quote): string | null {
|
|
148
149
|
const venue = calendarVenue(quote);
|
|
149
|
-
|
|
150
|
+
// A Cboe index's days are Cboe's own: one with its own sessions (the Russell 2000, quoted under CHICAGO OPTIONS) is
|
|
151
|
+
// dated by them; a yield index, which skips the bond market's holidays, is not dated here.
|
|
152
|
+
if (venue === "CBOE") {
|
|
153
|
+
const zone = isCboeYieldIndex(quote) ? null : quote.indexSession?.timeZone;
|
|
154
|
+
const date = zone ? zonedDateKey(quote.lastUpdated, zone) : null;
|
|
155
|
+
return date ? ownIndexSession(quote, date) : null;
|
|
156
|
+
}
|
|
150
157
|
const zone = sessionCalendarTimeZone(venue) ?? quote.indexSession?.timeZone;
|
|
151
158
|
if (!zone) return null;
|
|
152
159
|
const date = zonedDateKey(quote.lastUpdated, zone);
|
|
153
|
-
if (!date
|
|
160
|
+
if (!date) return null;
|
|
161
|
+
if (!hasPublishedSessionCalendar(venue, date)) return ownIndexSession(quote, date);
|
|
162
|
+
if (!isVenueTradingDay(venue, date)) return null;
|
|
154
163
|
const open = latestRegularSessionOpen(venue, quote.lastUpdated);
|
|
155
164
|
return open != null && zonedDateKey(open, zone) === date ? date : null;
|
|
156
165
|
}
|
|
157
166
|
|
|
167
|
+
/**
|
|
168
|
+
* For an index whose venue publishes no calendar (the Euro Stoxx 50 and the
|
|
169
|
+
* FTSE 100, quoted under their publishers' ZURICH and FTSE INDEX), the
|
|
170
|
+
* session of the index's own calendar (indexSession) its print sits in: one
|
|
171
|
+
* that opened on `date`, at or before the print. Null when none did.
|
|
172
|
+
*/
|
|
173
|
+
function ownIndexSession(quote: Quote, date: string): string | null {
|
|
174
|
+
const session = quote.indexSession;
|
|
175
|
+
if (!session?.timeZone) return null;
|
|
176
|
+
const windows = [...session.regular, ...(session.current ? [session.current] : [])];
|
|
177
|
+
return windows.some((window) => window.start <= quote.lastUpdated && zonedDateKey(window.start, session.timeZone) === date) ? date : null;
|
|
178
|
+
}
|
|
179
|
+
|
|
158
180
|
/** A coin on the spot crypto venue: its day is the UTC day. */
|
|
159
181
|
function isSpotCoin(quote: Quote): boolean {
|
|
160
182
|
return quoteVenue(quote) === "CCC";
|
|
@@ -2,7 +2,7 @@ import type { PriceBasis } from "../../types/instrument";
|
|
|
2
2
|
import type { Quote } from "../../types/financials";
|
|
3
3
|
import { resolvePriceBasis } from "./price-basis";
|
|
4
4
|
import { isIndexLevel } from "./index-level";
|
|
5
|
-
import { currencyPriceDigits, formatCompact, formatCurrency, formatCurrencyCode } from "../../utils/format";
|
|
5
|
+
import { MISSING_VALUE, currencyPriceDigits, formatCompact, formatCurrency, formatCurrencyCode } from "../../utils/format";
|
|
6
6
|
import { BIDI_MARKS, isDrawableCurrencySign, minorUnitSign } from "../../utils/currency-units";
|
|
7
7
|
import { fxRateDigits } from "../../utils/currency-pair";
|
|
8
8
|
|
|
@@ -283,7 +283,7 @@ export function formatPriceObservation(
|
|
|
283
283
|
value: number,
|
|
284
284
|
options: Pick<MarketFormatOptions, "maxWidth" | "minimumFractionDigits"> = {},
|
|
285
285
|
): string {
|
|
286
|
-
if (!Number.isFinite(value)) return
|
|
286
|
+
if (!Number.isFinite(value)) return MISSING_VALUE;
|
|
287
287
|
return formatPriceNumber(value, 8, options.maxWidth, Math.max(0, Math.min(8, options.minimumFractionDigits ?? 0)));
|
|
288
288
|
}
|
|
289
289
|
|
|
@@ -362,7 +362,7 @@ export function resolveAssetDisplayKind({
|
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
export function formatMarketQuantity(value: number | undefined, options: MarketFormatOptions = {}): string {
|
|
365
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
365
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
366
366
|
if (options.priceBasis === "percent-of-par") {
|
|
367
367
|
const suffix = `${options.quantityCurrency ? ` ${options.quantityCurrency}` : ""} face`;
|
|
368
368
|
const maxWidth = options.maxWidth == null ? undefined : Math.max(1, options.maxWidth - suffix.length);
|
|
@@ -403,9 +403,9 @@ function tickFractionDigits(tick: number | undefined): number | undefined {
|
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
export function formatMarketPrice(value: number | undefined, options: MarketFormatOptions = {}): string {
|
|
406
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
406
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
407
407
|
const basis = resolvePriceBasis(options.priceBasis, options.assetCategory);
|
|
408
|
-
if (basis === null) return
|
|
408
|
+
if (basis === null) return MISSING_VALUE;
|
|
409
409
|
if (basis === "thirty-seconds") return formatThirtySeconds(value);
|
|
410
410
|
if (basis === "points") return formatMarketPrice(value, { ...options, priceBasis: "per-unit" });
|
|
411
411
|
if (basis === "percent-of-par") {
|
|
@@ -453,9 +453,9 @@ export function formatMarketPrice(value: number | undefined, options: MarketForm
|
|
|
453
453
|
}
|
|
454
454
|
|
|
455
455
|
export function formatMarketCost(value: number | undefined, options: MarketFormatOptions = {}): string {
|
|
456
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
456
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
457
457
|
const basis = resolvePriceBasis(options.priceBasis, options.assetCategory);
|
|
458
|
-
if (basis === null) return
|
|
458
|
+
if (basis === null) return MISSING_VALUE;
|
|
459
459
|
if (basis === "thirty-seconds") return formatThirtySeconds(value);
|
|
460
460
|
if (basis === "points") return formatMarketCost(value, { ...options, priceBasis: "per-unit" });
|
|
461
461
|
if (basis === "percent-of-par") {
|
|
@@ -469,8 +469,8 @@ export function formatMarketCost(value: number | undefined, options: MarketForma
|
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
export function formatSignedMarketPrice(value: number | undefined, options: MarketFormatOptions = {}): string {
|
|
472
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
473
|
-
if (resolvePriceBasis(options.priceBasis, options.assetCategory) === null) return
|
|
472
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
473
|
+
if (resolvePriceBasis(options.priceBasis, options.assetCategory) === null) return MISSING_VALUE;
|
|
474
474
|
if (options.fixedFractionDigits !== undefined) {
|
|
475
475
|
// A move at the instrument's fixed decimals: the sign always has its column,
|
|
476
476
|
// and a move that rounds to zero is unsigned (0.00, never +0.00 or -0.00).
|
|
@@ -495,7 +495,7 @@ export function formatMarketChangeWithCurrency(
|
|
|
495
495
|
options: MarketFormatOptions = {},
|
|
496
496
|
referencePrice?: number,
|
|
497
497
|
): string {
|
|
498
|
-
if (value == null || !Number.isFinite(value)) return
|
|
498
|
+
if (value == null || !Number.isFinite(value)) return MISSING_VALUE;
|
|
499
499
|
if (isIndexLevel(options.assetCategory) || resolvePriceBasis(options.priceBasis, options.assetCategory) !== "per-unit") return formatSignedMarketPrice(value, options);
|
|
500
500
|
if (options.fixedFractionDigits !== undefined) {
|
|
501
501
|
const maxWidth = options.maxWidth == null ? undefined : Math.max(1, options.maxWidth - 1);
|
|
@@ -739,7 +739,7 @@ export function formatMarketPriceWithCurrency(
|
|
|
739
739
|
currency = "USD",
|
|
740
740
|
options: MarketFormatOptions = {},
|
|
741
741
|
): string {
|
|
742
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
742
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
743
743
|
if (isIndexLevel(options.assetCategory) || resolvePriceBasis(options.priceBasis, options.assetCategory) !== "per-unit") return formatMarketPrice(value, options);
|
|
744
744
|
const normalizedCurrency = currency.trim().toUpperCase() || "USD";
|
|
745
745
|
const sign = value < 0 ? "-" : "";
|
|
@@ -756,7 +756,7 @@ export function formatMarketCostWithCurrency(
|
|
|
756
756
|
currency = "USD",
|
|
757
757
|
options: MarketFormatOptions = {},
|
|
758
758
|
): string {
|
|
759
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
759
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
760
760
|
if (resolvePriceBasis(options.priceBasis, options.assetCategory) !== "per-unit") return formatMarketCost(value, options);
|
|
761
761
|
const normalizedCurrency = currency.trim().toUpperCase() || "USD";
|
|
762
762
|
const sign = value < 0 ? "-" : "";
|
|
@@ -780,7 +780,7 @@ export function formatCompactMarketPriceWithCurrency(
|
|
|
780
780
|
currency = "USD",
|
|
781
781
|
options: MarketFormatOptions = {},
|
|
782
782
|
): string {
|
|
783
|
-
if (value === undefined || value === null || Number.isNaN(value)) return
|
|
783
|
+
if (value === undefined || value === null || Number.isNaN(value)) return MISSING_VALUE;
|
|
784
784
|
const abs = Math.abs(value);
|
|
785
785
|
|
|
786
786
|
if (abs >= 1e6) {
|
|
@@ -3,7 +3,7 @@ import { cashAndShortTermInvestments } from "../../utils/cash-runway";
|
|
|
3
3
|
import { formatShortDate } from "../../utils/datetime-format";
|
|
4
4
|
import { formatCompact } from "../../utils/format";
|
|
5
5
|
import {
|
|
6
|
-
checkCashBasis, enterpriseValueCheck, enterpriseValueNotMeaningful, enterpriseValueWithdrawn, reportedEnterpriseValue,
|
|
6
|
+
checkCashBasis, enterpriseValueCheck, enterpriseValueNotMeaningful, enterpriseValueWithdrawn, reportedEnterpriseValue, withFinancialEnterpriseValue,
|
|
7
7
|
} from "../../utils/fundamentals";
|
|
8
8
|
import { debtAndLeases, leaseBasis } from "../../utils/lease-liabilities";
|
|
9
9
|
import { viewMarketCapitalization } from "../../utils/market-capitalization";
|
|
@@ -91,7 +91,7 @@ export const balanceSheetDay = (date: string) => formatShortDate(`${date.slice(0
|
|
|
91
91
|
* meaningful at or below zero and for a bank.
|
|
92
92
|
*/
|
|
93
93
|
export function listingEnterpriseValue(financials: EnterpriseValueInputs, now = Date.now()): ListingEnterpriseValue {
|
|
94
|
-
const priced = atRegularSessionPrice({ quote: financials.quote, fundamentals:
|
|
94
|
+
const priced = atRegularSessionPrice({ quote: financials.quote, fundamentals: withFinancialEnterpriseValue(financials.fundamentals, financials.profile) });
|
|
95
95
|
const fundamentals = priced.fundamentals;
|
|
96
96
|
const notMeaningful = enterpriseValueNotMeaningful(fundamentals);
|
|
97
97
|
if (notMeaningful) return { kind: "not-meaningful", reason: notMeaningful };
|
|
@@ -230,7 +230,7 @@ function statementBridge(
|
|
|
230
230
|
export function balanceSheetRateWanted(financials: EnterpriseValueInputs, now = Date.now()): Omit<BalanceSheetRate, "rate" | "closeDate"> | null {
|
|
231
231
|
const { annualStatements, quarterlyStatements } = financials;
|
|
232
232
|
if (!annualStatements || !quarterlyStatements) return null;
|
|
233
|
-
const priced = atRegularSessionPrice({ quote: financials.quote, fundamentals:
|
|
233
|
+
const priced = atRegularSessionPrice({ quote: financials.quote, fundamentals: withFinancialEnterpriseValue(financials.fundamentals, financials.profile) });
|
|
234
234
|
const fundamentals = priced.fundamentals;
|
|
235
235
|
if (enterpriseValueNotMeaningful(fundamentals) || reportedEnterpriseValue(fundamentals) != null || !enterpriseValueWithdrawn(fundamentals)) return null;
|
|
236
236
|
const check = enterpriseValueCheck(fundamentals);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../utils/format";
|
|
1
2
|
import type { Quote } from "../../types/financials";
|
|
2
3
|
import { getLanguage, tf } from "../../i18n";
|
|
3
4
|
import { isPerpetualExchange } from "../../tickers/perpetual-listing";
|
|
4
5
|
import { formatUtcDayTime, formatUtcWeekdayTime } from "../../utils/utc-time";
|
|
6
|
+
import { formatShortDate } from "../../utils/datetime-format";
|
|
5
7
|
import { delayedFeedLagMs } from "../market/freshness";
|
|
6
8
|
import { quoteHeadlineTime, quoteSessionStateLabel } from "../market/status";
|
|
7
9
|
import { dailyNavDate, isQuoteStaleForCurrentSession } from "./freshness";
|
|
@@ -11,12 +13,17 @@ export function formatQuoteNavAsOf(quote: Quote | null | undefined, now = Date.n
|
|
|
11
13
|
const date = quote && dailyNavDate(quote, now);
|
|
12
14
|
if (!date) return null;
|
|
13
15
|
const sourceDate = new Date(`${date}T00:00:00Z`);
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const otherYear = sourceDate.getUTCFullYear() !== new Date(now).getUTCFullYear();
|
|
17
|
+
// English reads the day first, as every other date does; another language writes the day its own way.
|
|
18
|
+
const language = getLanguage();
|
|
19
|
+
const dateText = language === "en"
|
|
20
|
+
? formatShortDate(sourceDate, { utc: true, year: otherYear ? "numeric" : false })
|
|
21
|
+
: new Intl.DateTimeFormat(language, {
|
|
22
|
+
timeZone: "UTC",
|
|
23
|
+
month: "short",
|
|
24
|
+
day: "numeric",
|
|
25
|
+
...(otherYear ? { year: "numeric" as const } : {}),
|
|
26
|
+
}).format(sourceDate);
|
|
20
27
|
return tf("NAV · as of {date}", { date: dateText });
|
|
21
28
|
}
|
|
22
29
|
|
|
@@ -72,7 +79,7 @@ export interface QuoteAgeFormatOptions {
|
|
|
72
79
|
|
|
73
80
|
export function formatQuoteAge(lastUpdated: number | undefined, now = Date.now(), options: QuoteAgeFormatOptions = {}): string {
|
|
74
81
|
const clamped = clampQuoteTimestamp(lastUpdated, now);
|
|
75
|
-
if (clamped == null) return
|
|
82
|
+
if (clamped == null) return MISSING_VALUE;
|
|
76
83
|
|
|
77
84
|
// A receipt or source time ahead of the clock is fresh, never negative.
|
|
78
85
|
const ageMs = Math.max(0, now - clamped);
|
|
@@ -99,11 +106,11 @@ export function formatQuoteAgeWithSource(
|
|
|
99
106
|
now = Date.now(),
|
|
100
107
|
options: QuoteAgeFormatOptions = {},
|
|
101
108
|
): string {
|
|
102
|
-
if (!quote) return
|
|
109
|
+
if (!quote) return MISSING_VALUE;
|
|
103
110
|
|
|
104
111
|
const timestamp = resolveQuoteAgeTimestamp(quote, now);
|
|
105
|
-
const age = timestamp == null ?
|
|
106
|
-
if (age ===
|
|
112
|
+
const age = timestamp == null ? MISSING_VALUE : formatQuoteAge(timestamp, now, options);
|
|
113
|
+
if (age === MISSING_VALUE) return age;
|
|
107
114
|
|
|
108
115
|
const prefix = quote.dataSource === "delayed" ? "◷" : "";
|
|
109
116
|
return prefix ? `${prefix}${age}` : age;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../utils/format";
|
|
1
2
|
import { apiClient } from "../api-client";
|
|
2
3
|
import type { FundBondFacts } from "../api-client/fund-facts";
|
|
3
4
|
import type { HeadlessPaneEntry, HeadlessPaneOptionDef } from "../types/headless";
|
|
@@ -368,7 +369,7 @@ export function taxEquivalentLines(analysis: TaxEquivalentAnalysis): TaxEquivale
|
|
|
368
369
|
{ key: "taxRate", label: "Tax rate", text: `${formatRate(combined)} (${stateText})`, value: combined, unit: "%", export: exportPercent(formatRate(combined), null) },
|
|
369
370
|
];
|
|
370
371
|
if (analysis.notApplicable || !analysis.basis || analysis.taxEquivalentYield == null) {
|
|
371
|
-
const reason = analysis.notApplicable ??
|
|
372
|
+
const reason = analysis.notApplicable ?? MISSING_VALUE;
|
|
372
373
|
lines.push({ key: "taxEquivalentYield", label: "Tax-equivalent yield", text: reason, value: null, export: { formatted: reason, asOf: null } });
|
|
373
374
|
return lines;
|
|
374
375
|
}
|
|
@@ -394,7 +395,7 @@ export function taxEquivalentLines(analysis: TaxEquivalentAnalysis): TaxEquivale
|
|
|
394
395
|
value: Math.round(ratio.value * 10_000) / 10_000,
|
|
395
396
|
export: exportPercent(ratioText, ratioAsOf),
|
|
396
397
|
}
|
|
397
|
-
: { key: "muniTreasuryRatio", label: "Muni/Treasury ratio", text: analysis.ratioNote ??
|
|
398
|
+
: { key: "muniTreasuryRatio", label: "Muni/Treasury ratio", text: analysis.ratioNote ?? MISSING_VALUE, value: null, export: { formatted: analysis.ratioNote ?? "—", asOf: null } });
|
|
398
399
|
return lines;
|
|
399
400
|
}
|
|
400
401
|
|
package/src/news/aggregator.ts
CHANGED
|
@@ -170,7 +170,7 @@ export class NewsService {
|
|
|
170
170
|
if (!recoversDataRequests(sourceId) || !this.polling) return;
|
|
171
171
|
for (const entry of this.queries.values()) {
|
|
172
172
|
// A list missing some of its sources is read again too, keeping what it shows meanwhile.
|
|
173
|
-
if (entry.refs > 0 && entry.state.error != null)
|
|
173
|
+
if (entry.refs > 0 && entry.state.error != null) this.refreshQuery(entry.query, entry.state.phase === "error");
|
|
174
174
|
}
|
|
175
175
|
}) ?? null;
|
|
176
176
|
this.scheduleNextPoll();
|
|
@@ -217,7 +217,7 @@ export class NewsService {
|
|
|
217
217
|
this.notify();
|
|
218
218
|
}
|
|
219
219
|
for (const entry of this.queries.values()) {
|
|
220
|
-
|
|
220
|
+
this.refreshQuery(entry.query, true);
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
223
|
}
|
|
@@ -263,7 +263,7 @@ export class NewsService {
|
|
|
263
263
|
const unsubscribe = this.subscribe(emit);
|
|
264
264
|
// Show loading before emitting: the fetch below starts immediately, and an
|
|
265
265
|
// idle first frame paints an empty pane instead of a loading one.
|
|
266
|
-
|
|
266
|
+
this.refreshQuery(normalized, true);
|
|
267
267
|
emit();
|
|
268
268
|
|
|
269
269
|
let disposed = false;
|
|
@@ -300,10 +300,16 @@ export class NewsService {
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
async load(query: NewsQuery): Promise<NewsQueryState> {
|
|
303
|
-
return this.
|
|
303
|
+
return this.refreshQueryAndWait(normalizeNewsQuery(query), true);
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
/** Asks for the next page. A failed page clears `loadingMore`; anything else is logged. */
|
|
307
|
+
loadMore(query: NewsQuery): void {
|
|
308
|
+
this.loadMoreAndWait(query).catch(logFailure("news.aggregator", "Loading more news failed"));
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** `loadMore` for a caller that waits until the page or its failure is in state. */
|
|
312
|
+
async loadMoreAndWait(query: NewsQuery): Promise<void> {
|
|
307
313
|
const normalized = normalizeNewsQuery(query);
|
|
308
314
|
const entry = this.queries.get(buildNewsQueryKey(normalized));
|
|
309
315
|
if (!entry || entry.loadMoreInFlight || !entry.state.nextCursor || entry.state.loadingMore) return;
|
|
@@ -398,7 +404,7 @@ export class NewsService {
|
|
|
398
404
|
}
|
|
399
405
|
|
|
400
406
|
async poll(query: NewsQuery = DEFAULT_GLOBAL_QUERY): Promise<void> {
|
|
401
|
-
await this.
|
|
407
|
+
await this.refreshQueryAndWait(normalizeNewsQuery(query), false);
|
|
402
408
|
}
|
|
403
409
|
|
|
404
410
|
private async pollActiveQueries(): Promise<void> {
|
|
@@ -407,10 +413,15 @@ export class NewsService {
|
|
|
407
413
|
.filter((entry) => entry.refs > 0)
|
|
408
414
|
.map((entry) => entry.query);
|
|
409
415
|
if (queries.length === 0) return;
|
|
410
|
-
await Promise.allSettled(queries.map((query) => this.
|
|
416
|
+
await Promise.allSettled(queries.map((query) => this.refreshQueryAndWait(query, false)));
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/** A read nobody waits on. A failed read lands in the query's state; anything else is logged. */
|
|
420
|
+
private refreshQuery(query: NewsQuery, showLoading: boolean): void {
|
|
421
|
+
this.refreshQueryAndWait(query, showLoading).catch(logFailure("news.aggregator", "Refreshing a news query failed"));
|
|
411
422
|
}
|
|
412
423
|
|
|
413
|
-
private async
|
|
424
|
+
private async refreshQueryAndWait(
|
|
414
425
|
query: NewsQuery,
|
|
415
426
|
showLoading: boolean,
|
|
416
427
|
): Promise<NewsQueryState> {
|
package/src/news/hooks.ts
CHANGED
|
@@ -48,7 +48,7 @@ function useNewsLoadMore(query: NewsQuery | null | undefined): () => void {
|
|
|
48
48
|
const key = query ? buildNewsQueryKey(query) : null;
|
|
49
49
|
return useCallback(() => {
|
|
50
50
|
if (!query) return;
|
|
51
|
-
|
|
51
|
+
sharedService?.loadMore(query);
|
|
52
52
|
}, [key]);
|
|
53
53
|
}
|
|
54
54
|
|
package/src/news/news-model.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { coinSearchName } from "../utils/crypto-pair";
|
|
2
|
+
import { formatShortDate } from "../utils/datetime-format";
|
|
2
3
|
import { canonicalExchange, normalizeSymbol } from "../utils/exchanges";
|
|
3
4
|
import type { NewsCapability } from "../capabilities";
|
|
4
5
|
import type { NewsArticle, NewsFeed, NewsQuery, NewsQueryState } from "./types";
|
|
@@ -288,6 +289,54 @@ export function summaryRestatesHeadline(title: string, summary: string): boolean
|
|
|
288
289
|
return words.filter((word) => !known(word)).length <= words.length * RESTATED_NEW_WORDS;
|
|
289
290
|
}
|
|
290
291
|
|
|
292
|
+
/**
|
|
293
|
+
* What a company feed's row of routine notices stands for, after its headline: "8 notices since 30 Oct"
|
|
294
|
+
* (a buy-back's daily "Transaction in own shares", folded into its latest). Null for any other row.
|
|
295
|
+
*/
|
|
296
|
+
function routineNoticesText(article: Pick<NewsArticle, "routine" | "publishedAt">): string | null {
|
|
297
|
+
const routine = article.routine;
|
|
298
|
+
if (!routine || routine.notices < 2) return null;
|
|
299
|
+
// A day kept as text (a pane's state restored from disk) is read as one; an unreadable one names none.
|
|
300
|
+
const since = routine.since instanceof Date ? routine.since : new Date(String(routine.since));
|
|
301
|
+
if (Number.isNaN(since.getTime())) return `${routine.notices} notices`;
|
|
302
|
+
// The year is named only when the run began in another year than its latest notice.
|
|
303
|
+
const latest = article.publishedAt instanceof Date ? article.publishedAt : new Date(String(article.publishedAt));
|
|
304
|
+
const sameYear = since.getUTCFullYear() === latest.getUTCFullYear();
|
|
305
|
+
return `${routine.notices} notices since ${formatShortDate(since, { year: sameYear ? false : "numeric", utc: true })}`;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/** The headline a list shows: with the notices a folded row stands for ("Transaction in own shares (8 notices since 30 Oct)"). */
|
|
309
|
+
export function listedHeadline(article: Pick<NewsArticle, "title" | "routine" | "publishedAt">): string {
|
|
310
|
+
const notices = routineNoticesText(article);
|
|
311
|
+
return notices ? `${article.title} (${notices})` : article.title;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/** The fields an exported row keeps of the notices a folded row stands for: none for any other row. */
|
|
315
|
+
export function routineNoticeFields(article: Pick<NewsArticle, "routine">) {
|
|
316
|
+
const routine = article.routine;
|
|
317
|
+
const since = routine ? (routine.since instanceof Date ? routine.since : new Date(String(routine.since))) : null;
|
|
318
|
+
return routine && since && !Number.isNaN(since.getTime()) ? {
|
|
319
|
+
routineKind: routine.kind,
|
|
320
|
+
routineNotices: routine.notices,
|
|
321
|
+
routineSince: since.toISOString(),
|
|
322
|
+
routineProgramme: routine.programme,
|
|
323
|
+
} : {};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* A text table's headline from an exported row: its title, with the notices a folded row stands for
|
|
328
|
+
* (`routineNoticeFields`) after it. Exports keep the title and the count apart.
|
|
329
|
+
*/
|
|
330
|
+
export function listedRowHeadline(title: unknown, row: Record<string, unknown>): string {
|
|
331
|
+
const text = String(title ?? "");
|
|
332
|
+
if (typeof row.routineNotices !== "number" || typeof row.routineSince !== "string") return text;
|
|
333
|
+
return listedHeadline({
|
|
334
|
+
title: text,
|
|
335
|
+
routine: { kind: String(row.routineKind ?? ""), notices: row.routineNotices, since: new Date(row.routineSince), programme: null },
|
|
336
|
+
publishedAt: new Date(String(row.publishedAt ?? row.routineSince)),
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
|
|
291
340
|
/**
|
|
292
341
|
* A story's summary as one line under its row in a text list (`news`,
|
|
293
342
|
* `fn CN`): its whitespace and line breaks run together, null when it has
|
package/src/news/types.ts
CHANGED
|
@@ -42,6 +42,8 @@ export interface NewsArticle {
|
|
|
42
42
|
isDeveloping: boolean;
|
|
43
43
|
sourceCount?: number;
|
|
44
44
|
items?: NewsStoryItem[];
|
|
45
|
+
/** The routine notices the story stands for in a company's feed (a buy-back's daily notices), its own included. */
|
|
46
|
+
routine?: NewsRoutineNotices;
|
|
45
47
|
/**
|
|
46
48
|
* The text this story was found by, when it stands in for a coin pair's feed
|
|
47
49
|
* no story is filed under: the stories that mention "bitcoin" for BTC-USD.
|
|
@@ -52,6 +54,13 @@ export interface NewsArticle {
|
|
|
52
54
|
importance: number;
|
|
53
55
|
}
|
|
54
56
|
|
|
57
|
+
interface NewsRoutineNotices {
|
|
58
|
+
kind: string;
|
|
59
|
+
notices: number;
|
|
60
|
+
since: Date;
|
|
61
|
+
programme: string | null;
|
|
62
|
+
}
|
|
63
|
+
|
|
55
64
|
export interface NewsQuery {
|
|
56
65
|
feed?: NewsFeed;
|
|
57
66
|
/** @deprecated Set `feed: "ticker"` instead. */
|
|
@@ -18,6 +18,7 @@ import { useAppLanguage } from "../../../i18n/react";
|
|
|
18
18
|
import { Box, useRendererHost } from "../../../ui";
|
|
19
19
|
import { useDialog } from "../../../ui/dialog";
|
|
20
20
|
import { formatTimeAgo } from "../../../utils/datetime-format";
|
|
21
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
21
22
|
|
|
22
23
|
type Message = { tone: "info" | "success" | "error"; text: string };
|
|
23
24
|
|
|
@@ -44,7 +45,8 @@ export function CalendarAccountTab({ width, sessionMarker }: { width: number; se
|
|
|
44
45
|
const [shownUrl, setShownUrl] = useState<string | null>(null);
|
|
45
46
|
const busyRef = useRef(false);
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
// A failed load lands in `loadError`. Retry waits on it, to stay busy until the answer is in.
|
|
49
|
+
const loadAndWait = useCallback(async (isCurrent: () => boolean = () => true) => {
|
|
48
50
|
setLoading(true);
|
|
49
51
|
setLoadError(null);
|
|
50
52
|
try {
|
|
@@ -56,6 +58,9 @@ export function CalendarAccountTab({ width, sessionMarker }: { width: number; se
|
|
|
56
58
|
if (isCurrent()) setLoading(false);
|
|
57
59
|
}
|
|
58
60
|
}, []);
|
|
61
|
+
const load = useCallback((isCurrent?: () => boolean) => {
|
|
62
|
+
loadAndWait(isCurrent).catch(logFailure("account-management.calendar-tab", "Loading the calendar link failed"));
|
|
63
|
+
}, [loadAndWait]);
|
|
59
64
|
|
|
60
65
|
useEffect(() => {
|
|
61
66
|
let current = true;
|
|
@@ -63,7 +68,7 @@ export function CalendarAccountTab({ width, sessionMarker }: { width: number; se
|
|
|
63
68
|
setFeed(null);
|
|
64
69
|
setShownUrl(null);
|
|
65
70
|
setMessage(null);
|
|
66
|
-
|
|
71
|
+
load(() => current);
|
|
67
72
|
return () => {
|
|
68
73
|
current = false;
|
|
69
74
|
};
|
|
@@ -165,7 +170,7 @@ export function CalendarAccountTab({ width, sessionMarker }: { width: number; se
|
|
|
165
170
|
<EmptyState
|
|
166
171
|
status="error"
|
|
167
172
|
title={loadError}
|
|
168
|
-
retry={{ onRetry: () =>
|
|
173
|
+
retry={{ onRetry: () => loadAndWait(), pending: loading }}
|
|
169
174
|
/>
|
|
170
175
|
);
|
|
171
176
|
}
|
|
@@ -483,7 +483,8 @@ export function AccountManagementPane({ focused, width, height }: PaneProps) {
|
|
|
483
483
|
return unsubscribe;
|
|
484
484
|
}, []);
|
|
485
485
|
|
|
486
|
-
|
|
486
|
+
// A load nobody waits on: a failure shows in the pane's message line.
|
|
487
|
+
const loadProfile = useCallback(() => {
|
|
487
488
|
if (!apiClient.isSignedIn()) {
|
|
488
489
|
setProfile(null);
|
|
489
490
|
setDraft(profileToDraft(null));
|
|
@@ -491,21 +492,20 @@ export function AccountManagementPane({ focused, width, height }: PaneProps) {
|
|
|
491
492
|
}
|
|
492
493
|
|
|
493
494
|
setMessage({ tone: "info", text: t("Loading account profile...") });
|
|
494
|
-
|
|
495
|
-
const nextProfile = await apiClient.getAccountProfile();
|
|
495
|
+
apiClient.getAccountProfile().then((nextProfile) => {
|
|
496
496
|
setProfile(nextProfile);
|
|
497
497
|
setDraft(profileToDraft(nextProfile));
|
|
498
498
|
setMessage(null);
|
|
499
|
-
}
|
|
499
|
+
}).catch((error: unknown) => {
|
|
500
500
|
setMessage({
|
|
501
501
|
tone: "error",
|
|
502
502
|
text: error instanceof Error ? error.message : t("Failed to load account profile."),
|
|
503
503
|
});
|
|
504
|
-
}
|
|
504
|
+
});
|
|
505
505
|
}, []);
|
|
506
506
|
|
|
507
507
|
useEffect(() => {
|
|
508
|
-
|
|
508
|
+
loadProfile();
|
|
509
509
|
}, [loadProfile, sessionMarker]);
|
|
510
510
|
|
|
511
511
|
// Pricing is decoration (the table falls back to list prices), but whether
|
|
@@ -514,11 +514,12 @@ export function AccountManagementPane({ focused, width, height }: PaneProps) {
|
|
|
514
514
|
// Signed out, the pane is the sign-in wall.
|
|
515
515
|
if (!apiClient.isSignedIn()) return;
|
|
516
516
|
let cancelled = false;
|
|
517
|
-
|
|
517
|
+
// A failed request answers an offer without prices; anything else is logged.
|
|
518
|
+
loadUpgradeOffer().then((offer) => {
|
|
518
519
|
if (cancelled) return;
|
|
519
520
|
if (offer.pricing) setPricing(offer.pricing);
|
|
520
521
|
setTrialAvailable(offer.trialAvailable);
|
|
521
|
-
});
|
|
522
|
+
}, logFailure("account-management.pane", "Load upgrade offer failed"));
|
|
522
523
|
return () => {
|
|
523
524
|
cancelled = true;
|
|
524
525
|
};
|