@gloom-sh/terminal 0.20.16 → 0.20.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/src/account/auth-dialog.tsx +19 -1
- package/src/account/billing.ts +2 -1
- package/src/account/heard-from-question.tsx +235 -0
- package/src/account/heard-from.ts +97 -0
- package/src/api-client/data.ts +16 -5
- package/src/api-client/heard-from.ts +72 -0
- package/src/api-client/index.ts +63 -6
- package/src/api-client/mna.ts +18 -0
- package/src/api-client/supply-chain.ts +9 -0
- package/src/api-client/types/billing.ts +35 -1
- package/src/api-client/types/econ.ts +3 -0
- package/src/app/global-shortcuts.ts +5 -3
- package/src/app/pro-welcome/keys.ts +27 -0
- package/src/app/pro-welcome/model.ts +158 -0
- package/src/app/pro-welcome/row.tsx +176 -0
- package/src/app/pro-welcome/use-pro-welcome.ts +156 -0
- package/src/app/runtime/external-profile-changes.ts +135 -0
- package/src/app.tsx +33 -2
- package/src/architecture/core-builtin-allowlist.json +1 -1
- package/src/architecture/floating-promise-allowlist.json +0 -1
- package/src/architecture/shortcut-labels-allowlist.json +1 -0
- package/src/cli/alert-listing.ts +98 -0
- package/src/cli/commands/fred-series.ts +3 -1
- package/src/cli/commands/market.ts +138 -22
- package/src/cli/commands/overview.ts +72 -14
- package/src/cli/commands/plugins.ts +3 -2
- package/src/cli/commands/search.ts +30 -6
- package/src/cli/context.ts +16 -5
- package/src/cli/csv-export.ts +74 -0
- package/src/cli/desktop-pane-shot.ts +75 -11
- package/src/cli/glossary.ts +64 -10
- package/src/cli/help.ts +4 -2
- package/src/cli/history-demergers.ts +117 -0
- package/src/cli/history-rows.ts +6 -2
- package/src/cli/index.ts +1 -0
- package/src/cli/known-gaps.ts +16 -0
- package/src/cli/known-us-stocks.ts +18 -0
- package/src/cli/listing-arg.ts +105 -15
- package/src/cli/pane-functions/catalog-snapshot-build.ts +83 -0
- package/src/cli/pane-functions/catalog-snapshot.json +866 -0
- package/src/cli/pane-functions/catalog-snapshot.ts +62 -0
- package/src/cli/pane-functions/catalog.ts +50 -16
- package/src/cli/pane-functions/data.ts +16 -4
- package/src/cli/pane-functions/dom.ts +24 -6
- package/src/cli/pane-functions/freshness.ts +17 -1
- package/src/cli/pane-functions/headless.ts +7 -2
- package/src/cli/pane-functions/index.ts +102 -44
- package/src/cli/pane-functions/resolver.ts +8 -5
- package/src/cli/pane-functions/screenshot-assessment.ts +30 -7
- package/src/cli/pane-functions/screenshot-bridge.ts +4 -2
- package/src/cli/pane-functions/screenshot-payload.ts +21 -0
- package/src/cli/pane-functions/screenshot-render.ts +3 -1
- package/src/cli/quote-answer.ts +32 -16
- package/src/cli/registry.ts +22 -2
- package/src/cli/report-tables.ts +17 -3
- package/src/cli/result.ts +8 -10
- package/src/cli/series-search.ts +45 -6
- package/src/cli/shot-temp-dir.ts +4 -9
- package/src/components/chart/composite/legend.tsx +80 -25
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +3 -3
- package/src/components/chart/composite/price-axis-labels.tsx +7 -5
- package/src/components/chart-table/header.tsx +9 -0
- package/src/components/chart-table/layout.ts +11 -11
- package/src/components/command-bar/pane-templates/items.ts +17 -1
- package/src/components/command-bar/routes/root/provider-search.ts +10 -1
- package/src/components/command-bar/routes/root/results.ts +34 -2
- package/src/components/command-bar/routes/root/runtime.ts +8 -1
- package/src/components/command-bar/routes/ticker-search/route.ts +5 -0
- package/src/components/command-bar/workflow/alert.ts +19 -8
- package/src/components/data-table/view.tsx +15 -2
- package/src/components/form-modal/content.tsx +9 -4
- package/src/components/index.ts +1 -1
- package/src/components/layout/header.tsx +9 -5
- package/src/components/layout/pane/capture-status.ts +6 -0
- package/src/components/layout/pane/footer/index.tsx +2 -0
- package/src/components/layout/pane/footer/model.ts +113 -15
- package/src/components/layout/pane/header.tsx +16 -2
- package/src/components/market-board/index.tsx +4 -2
- package/src/components/onboarding/onboarding-frame.tsx +6 -2
- package/src/components/onboarding/onboarding-keyboard.ts +7 -1
- package/src/components/onboarding/onboarding-wizard.tsx +3 -1
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +24 -15
- package/src/components/onboarding/setup-cards.ts +36 -0
- package/src/components/onboarding/use-onboarding-progress.ts +22 -1
- package/src/components/onboarding/wizard-account.ts +6 -1
- package/src/components/onboarding/wizard-model.ts +32 -6
- package/src/components/onboarding/wizard-positions.ts +1 -1
- package/src/components/sign-in-gate.tsx +3 -1
- package/src/components/toggle-list.tsx +6 -8
- package/src/components/ui/confirm-dialog.tsx +47 -7
- package/src/components/ui/data-table/display-columns.ts +4 -1
- package/src/components/ui/data-table/hooks.ts +2 -3
- package/src/components/ui/data-table/index.tsx +4 -1
- package/src/components/ui/data-table/types.ts +19 -4
- package/src/components/ui/data-table/visible-range.ts +11 -1
- package/src/components/ui/display.tsx +17 -2
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/stat-grid.tsx +4 -0
- package/src/components/ui/status.tsx +13 -1
- package/src/components/ui/table-layout.ts +2 -1
- package/src/components/use-pane-notice-footer.tsx +16 -3
- package/src/data/config/store/index.ts +31 -0
- package/src/data/config/store/node.ts +61 -11
- package/src/data/config/store/normalize.ts +4 -6
- package/src/data/config/store/shared-file.ts +309 -0
- package/src/data/profile-merge.ts +299 -0
- package/src/data/sqlite/checkpointer.ts +11 -1
- package/src/data/sqlite/database.ts +1 -1
- package/src/data/ticker-repository.ts +134 -10
- package/src/data/ticker-store.ts +67 -0
- package/src/data/ticker-writes.ts +5 -0
- package/src/i18n/es.ts +27 -0
- package/src/i18n/ja.ts +27 -0
- package/src/i18n/ko.ts +27 -0
- package/src/i18n/zh-cn.ts +27 -0
- package/src/i18n/zh-tw.ts +27 -0
- package/src/layout-marketplace/gallery-desktop.tsx +2 -2
- package/src/market-data/ah-pair.ts +103 -0
- package/src/market-data/depositary-pair.ts +6 -2
- package/src/market-data/hooks.tsx +33 -2
- package/src/market-data/market/change-basis.ts +2 -1
- package/src/market-data/market/header-market.ts +11 -0
- package/src/market-data/split-terms.ts +28 -0
- package/src/plugins/builtin/account-management/footer.ts +1 -1
- package/src/plugins/builtin/account-management/keyboard.ts +4 -0
- package/src/plugins/builtin/account-management/model.ts +1 -0
- package/src/plugins/builtin/account-management/pane.tsx +75 -7
- package/src/plugins/builtin/account-management/payment-recovery-row.tsx +12 -5
- package/src/plugins/builtin/account-management/pro-cancel.tsx +197 -0
- package/src/plugins/builtin/account-management/trial-cancel.ts +1 -1
- package/src/plugins/builtin/alerts/cli-move.ts +2 -2
- package/src/plugins/builtin/alerts/cli.ts +36 -30
- package/src/plugins/builtin/alerts/constants.ts +10 -0
- package/src/plugins/builtin/alerts/earnings-listing.ts +20 -0
- package/src/plugins/builtin/alerts/format.ts +24 -8
- package/src/plugins/builtin/alerts/index.tsx +38 -9
- package/src/plugins/builtin/alerts/move-checks.ts +7 -0
- package/src/plugins/builtin/alerts/pane.tsx +1 -1
- package/src/plugins/builtin/alerts/quotes.ts +26 -2
- package/src/plugins/builtin/alerts/scheduled.ts +6 -1
- package/src/plugins/builtin/alerts/types.ts +7 -0
- package/src/plugins/builtin/analytics/manual-value.ts +61 -0
- package/src/plugins/builtin/analytics/risk-book.ts +7 -7
- package/src/plugins/builtin/analytics/risk-client.ts +26 -13
- package/src/plugins/builtin/analytics/risk-headless.ts +13 -8
- package/src/plugins/builtin/analytics/risk-model.ts +92 -4
- package/src/plugins/builtin/analytics/risk-pane.tsx +85 -38
- package/src/plugins/builtin/awards/pane.tsx +7 -3
- package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
- package/src/plugins/builtin/central-bank-rates/model.ts +8 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -3
- package/src/plugins/builtin/chart-composer/cli-options.ts +4 -2
- package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +2 -6
- package/src/plugins/builtin/chart-composer/pane.tsx +9 -3
- package/src/plugins/builtin/cloud/auth-actions.tsx +11 -6
- package/src/plugins/builtin/cloud/company-picker.tsx +5 -3
- package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +9 -4
- package/src/plugins/builtin/company-kpis/latest.ts +45 -0
- package/src/plugins/builtin/company-kpis/model.ts +38 -8
- package/src/plugins/builtin/company-kpis/pane.tsx +22 -8
- package/src/plugins/builtin/composite/alt-data.ts +20 -0
- package/src/plugins/builtin/composite/application.ts +14 -0
- package/src/plugins/builtin/composite/broker.ts +12 -0
- package/src/plugins/builtin/composite/credit.ts +33 -0
- package/src/plugins/builtin/composite/crypto.ts +10 -0
- package/src/plugins/builtin/composite/earnings.ts +12 -0
- package/src/plugins/builtin/composite/filings.ts +13 -0
- package/src/plugins/builtin/composite/futures-commodities.ts +23 -0
- package/src/plugins/builtin/composite/global-markets.ts +12 -0
- package/src/plugins/builtin/composite/options-volatility.ts +23 -0
- package/src/plugins/builtin/composite/ownership.ts +23 -0
- package/src/plugins/builtin/composite/portfolio.ts +10 -0
- package/src/plugins/builtin/composite/quant.ts +15 -0
- package/src/plugins/builtin/composite/rates-macro.ts +30 -0
- package/src/plugins/builtin/composite/screeners.ts +11 -0
- package/src/plugins/builtin/composite/shared.ts +11 -0
- package/src/plugins/builtin/composite/ticker-core.ts +36 -0
- package/src/plugins/builtin/congress-trades/headless.ts +31 -3
- package/src/plugins/builtin/correlation/index.tsx +13 -17
- package/src/plugins/builtin/correlation/matrix/model.ts +18 -0
- package/src/plugins/builtin/credit-conditions/series.ts +2 -2
- package/src/plugins/builtin/dividend-yield/client.ts +57 -16
- package/src/plugins/builtin/dividend-yield/headless.ts +17 -11
- package/src/plugins/builtin/dividend-yield/model.ts +4 -3
- package/src/plugins/builtin/dividend-yield/pane.tsx +22 -18
- package/src/plugins/builtin/dividend-yield/ranking.ts +1 -1
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +23 -12
- package/src/plugins/builtin/earnings/board-model.ts +12 -0
- package/src/plugins/builtin/earnings/board-table.ts +7 -4
- package/src/plugins/builtin/earnings/board.tsx +2 -2
- package/src/plugins/builtin/earnings/fiscal-quarter.ts +39 -0
- package/src/plugins/builtin/earnings/headless.ts +7 -4
- package/src/plugins/builtin/earnings/highlight.ts +1 -1
- package/src/plugins/builtin/earnings/history-model.ts +6 -4
- package/src/plugins/builtin/earnings/history-table.ts +4 -3
- package/src/plugins/builtin/earnings-calls/pane.tsx +8 -2
- package/src/plugins/builtin/econ/calendar-model.ts +18 -0
- package/src/plugins/builtin/econ/fred-catalog.ts +1 -256
- package/src/plugins/builtin/econ/index.tsx +3 -0
- package/src/plugins/builtin/econ-statistics/cache.ts +1 -1
- package/src/plugins/builtin/econ-statistics/client.ts +11 -10
- package/src/plugins/builtin/econ-statistics/detail.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/headless.ts +42 -6
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/pane.tsx +7 -2
- package/src/plugins/builtin/econ-statistics/stats.ts +2 -1
- package/src/plugins/builtin/econ-statistics/view.ts +9 -3
- package/src/plugins/builtin/equity-screener/headless.ts +4 -1
- package/src/plugins/builtin/equity-screener/model.ts +7 -6
- package/src/plugins/builtin/estimate-revisions/headless.ts +1 -1
- package/src/plugins/builtin/exposure/model.ts +10 -0
- package/src/plugins/builtin/exposure/pane.tsx +10 -3
- package/src/plugins/builtin/fx-matrix/amount.ts +15 -1
- package/src/plugins/builtin/fx-matrix/headless.ts +12 -6
- package/src/plugins/builtin/fx-matrix/index.tsx +23 -5
- package/src/plugins/builtin/fx-matrix/settings.ts +9 -4
- package/src/plugins/builtin/kelly-sizer/pane.tsx +9 -4
- package/src/plugins/builtin/market-valuation/pane.tsx +22 -10
- package/src/plugins/builtin/mna/detail.tsx +67 -6
- package/src/plugins/builtin/mna/headless.ts +128 -13
- package/src/plugins/builtin/mna/model.ts +219 -16
- package/src/plugins/builtin/mna/pane.tsx +34 -6
- package/src/plugins/builtin/money-markets/model.ts +14 -5
- package/src/plugins/builtin/money-markets/pane.tsx +4 -3
- package/src/plugins/builtin/news/wire/news/footer.ts +3 -8
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +22 -6
- package/src/plugins/builtin/options-scenario/csp-screen.ts +39 -12
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +7 -5
- package/src/plugins/builtin/pe-band/client.ts +13 -1
- package/src/plugins/builtin/pe-band/headless.ts +2 -2
- package/src/plugins/builtin/pe-band/model.ts +63 -10
- package/src/plugins/builtin/pe-band/pane.tsx +5 -5
- package/src/plugins/builtin/portfolio-list/allocation-rows.ts +26 -7
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +66 -13
- package/src/plugins/builtin/portfolio-list/cli/render.ts +76 -33
- package/src/plugins/builtin/portfolio-list/headless.ts +69 -22
- package/src/plugins/builtin/portfolio-list/pane/data.ts +3 -3
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +29 -14
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +2 -2
- package/src/plugins/builtin/relative-rotation/pane.tsx +2 -3
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +5 -1
- package/src/plugins/builtin/research/event-model.ts +31 -13
- package/src/plugins/builtin/research/headless.ts +8 -1
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +19 -17
- package/src/plugins/builtin/sectors/index.tsx +6 -9
- package/src/plugins/builtin/shared/cloud-upgrade.ts +1 -1
- package/src/plugins/builtin/shared/earnings-report.ts +19 -4
- package/src/plugins/builtin/shared/fred-catalog.ts +256 -0
- package/src/plugins/builtin/shared/report-freshness.ts +2 -3
- package/src/plugins/builtin/shared/series-cache.ts +3 -0
- package/src/plugins/builtin/shared/series-detail-chart.tsx +3 -0
- package/src/plugins/builtin/short-interest/watch-pane.tsx +7 -7
- package/src/plugins/builtin/supply-chain/client.ts +34 -9
- package/src/plugins/builtin/supply-chain/evidence.ts +3 -2
- package/src/plugins/builtin/supply-chain/flow.tsx +4 -3
- package/src/plugins/builtin/supply-chain/graph-model.ts +14 -7
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +3 -1
- package/src/plugins/builtin/supply-chain/graph.tsx +6 -3
- package/src/plugins/builtin/supply-chain/headless.ts +19 -4
- package/src/plugins/builtin/supply-chain/model.ts +50 -6
- package/src/plugins/builtin/supply-chain/pane.tsx +76 -16
- package/src/plugins/builtin/ticker-detail/adr-pair/ah.ts +62 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +119 -20
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +67 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +31 -16
- package/src/plugins/builtin/ticker-detail/overview/model.ts +17 -1
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +4 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +9 -2
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +9 -2
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +5 -2
- package/src/plugins/builtin/time-sales/headless.ts +4 -1
- package/src/plugins/builtin/time-sales/pane.tsx +2 -0
- package/src/plugins/builtin/time-sales/window.ts +12 -0
- package/src/plugins/builtin/treasury-auctions/client.ts +4 -0
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -0
- package/src/plugins/builtin/treasury-daily/client.ts +23 -11
- package/src/plugins/builtin/volatility/model.ts +17 -0
- package/src/plugins/builtin/volatility/pane.tsx +13 -4
- package/src/plugins/builtin/world-indices/index.tsx +2 -0
- package/src/plugins/builtin/world-indices/table.tsx +15 -0
- package/src/plugins/builtin/world-venue-map/evidence.ts +3 -2
- package/src/plugins/builtin/world-venue-map/headless.ts +28 -16
- package/src/plugins/builtin/world-venue-map/index.ts +19 -6
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +9 -5
- package/src/plugins/builtin/world-venue-map/layers.ts +33 -11
- package/src/plugins/builtin/world-venue-map/map.tsx +12 -0
- package/src/plugins/builtin/world-venue-map/pane.tsx +35 -6
- package/src/plugins/builtin/world-venue-map/place.ts +119 -0
- package/src/plugins/catalog-data.ts +20 -0
- package/src/plugins/catalog-lazy.ts +51 -0
- package/src/plugins/catalog-ui.ts +16 -18
- package/src/plugins/host-smoke.ts +5 -2
- package/src/portfolio/allocation.ts +79 -19
- package/src/portfolio/cash-balances.ts +76 -0
- package/src/portfolio/mutations.ts +43 -8
- package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
- package/src/renderers/desktop/window-layouts.ts +14 -0
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/dom/host/tabs.tsx +57 -8
- package/src/renderers/dom/styles.css +13 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +4 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +22 -1
- package/src/renderers/electrobun/bun/window/native-min-size.ts +6 -1
- package/src/renderers/electrobun/shared/protocol.ts +4 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +2 -0
- package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +50 -12
- package/src/renderers/electrobun/view/remote/ticker-repository.ts +10 -0
- package/src/series/standalone-catalog.ts +5 -4
- package/src/series/standalone.ts +13 -7
- package/src/sources/gloomberb-cloud/fred-publisher.ts +25 -0
- package/src/sources/gloomberb-cloud/fred-series.ts +1 -1
- package/src/sources/gloomberb-cloud/index.ts +14 -3
- package/src/sources/gloomberb-cloud/perpetuals.ts +60 -3
- package/src/sources/provider-router/financials.ts +20 -13
- package/src/sources/provider-router/index.ts +4 -0
- package/src/sources/provider-router/search.ts +1 -0
- package/src/sync/collections-contributor.ts +3 -1
- package/src/sync/config-merge.ts +10 -1
- package/src/sync/sanitize.ts +26 -2
- package/src/tickers/company-name-listing.ts +16 -2
- package/src/tickers/listing-fate.ts +12 -8
- package/src/tickers/renamed-listings.ts +43 -10
- package/src/tickers/search/home-listing.ts +28 -0
- package/src/tickers/search/index.ts +19 -7
- package/src/tickers/terminal-codes.ts +11 -1
- package/src/time-series/base-series.ts +3 -0
- package/src/time-series/ice-credit.ts +1 -0
- package/src/time-series/resolve.ts +3 -1
- package/src/time-series/spec.ts +2 -2
- package/src/time-series/types.ts +2 -1
- package/src/types/data-provider.ts +11 -0
- package/src/types/financials.ts +39 -3
- package/src/types/headless.ts +4 -2
- package/src/types/ticker.ts +10 -2
- package/src/utils/cli-output.ts +1 -1
- package/src/utils/declared-dividends.ts +13 -1
- package/src/utils/dividend-cash.ts +5 -1
- package/src/utils/forward-dividend.ts +4 -3
- package/src/utils/remove-folder.ts +37 -0
- package/src/utils/throttled-fetch.ts +15 -1
- package/src/utils/trailing-dividend.ts +1 -1
- package/src/plugins/builtin/composite-plugins.ts +0 -285
package/src/i18n/ja.ts
CHANGED
|
@@ -1612,6 +1612,12 @@ export const ja: Record<string, string> = {
|
|
|
1612
1612
|
"TICKERS": "銘柄",
|
|
1613
1613
|
"Which tickers do you follow?": "どの銘柄をフォローしていますか?",
|
|
1614
1614
|
"Pick up to 3 for your watchlist.": "ウォッチリストに入れる銘柄を最大3つ選べます。",
|
|
1615
|
+
// "Where did you hear about Gloom?", once, after an account signs up
|
|
1616
|
+
"Where did you hear about Gloom?": "Gloom をどこで知りましたか?",
|
|
1617
|
+
"AI assistant": "AI アシスタント",
|
|
1618
|
+
"Friend or colleague": "友人・同僚",
|
|
1619
|
+
"Article or newsletter": "記事・ニュースレター",
|
|
1620
|
+
"Where?": "どこで?",
|
|
1615
1621
|
"Skip": "スキップ",
|
|
1616
1622
|
"Equities": "株式",
|
|
1617
1623
|
"Futures & commodities": "先物・コモディティ",
|
|
@@ -1822,4 +1828,25 @@ export const ja: Record<string, string> = {
|
|
|
1822
1828
|
"pre": "開始前",
|
|
1823
1829
|
"post": "時間外",
|
|
1824
1830
|
"closed": "休場",
|
|
1831
|
+
// ── Pro: the first weeks' row and the paid cancel ──────────
|
|
1832
|
+
"Try Pro on your tickers": "あなたの銘柄で Pro を試す",
|
|
1833
|
+
"Try Pro": "Pro を試す",
|
|
1834
|
+
"Stop suggesting Pro functions": "Pro 機能の提案を表示しない",
|
|
1835
|
+
"Open {command}": "{command} を開く",
|
|
1836
|
+
"Options flow": "オプションフロー",
|
|
1837
|
+
"X mentions": "X での言及",
|
|
1838
|
+
"Hiring": "採用",
|
|
1839
|
+
"8-K events": "8-K イベント",
|
|
1840
|
+
"Risk factors": "リスク要因",
|
|
1841
|
+
"Cancel Pro": "Pro を解約",
|
|
1842
|
+
"Cancel Pro?": "Pro を解約しますか?",
|
|
1843
|
+
"Keep Pro": "Pro を続ける",
|
|
1844
|
+
"Pro until {date}": "Pro({date} まで)",
|
|
1845
|
+
"Cancelling...": "解約中...",
|
|
1846
|
+
"Cancel Subscription": "サブスクリプションを解約",
|
|
1847
|
+
"Keep My Subscription": "サブスクリプションを続ける",
|
|
1848
|
+
"Continue Cancellation": "解約を続ける",
|
|
1849
|
+
"Pro stays on until {date}.": "Pro は {date} までご利用いただけます。",
|
|
1850
|
+
"Pro stays on until {date}. Cancelling now stops the renewal after that date.": "Pro は {date} までご利用いただけます。今解約すると、その日以降は更新されません。",
|
|
1851
|
+
"Cancelled. Pro stays on until {date}.": "解約しました。Pro は {date} までご利用いただけます。",
|
|
1825
1852
|
};
|
package/src/i18n/ko.ts
CHANGED
|
@@ -1610,6 +1610,12 @@ export const ko: Record<string, string> = {
|
|
|
1610
1610
|
"TICKERS": "종목",
|
|
1611
1611
|
"Which tickers do you follow?": "어떤 종목을 팔로우하시나요?",
|
|
1612
1612
|
"Pick up to 3 for your watchlist.": "관심 목록에 넣을 종목을 최대 3개까지 고르세요.",
|
|
1613
|
+
// "Where did you hear about Gloom?", once, after an account signs up
|
|
1614
|
+
"Where did you hear about Gloom?": "Gloom을 어디서 알게 되셨나요?",
|
|
1615
|
+
"AI assistant": "AI 어시스턴트",
|
|
1616
|
+
"Friend or colleague": "친구 또는 동료",
|
|
1617
|
+
"Article or newsletter": "기사 또는 뉴스레터",
|
|
1618
|
+
"Where?": "어디서?",
|
|
1613
1619
|
"Skip": "건너뛰기",
|
|
1614
1620
|
"Equities": "주식",
|
|
1615
1621
|
"Futures & commodities": "선물 및 원자재",
|
|
@@ -1820,4 +1826,25 @@ export const ko: Record<string, string> = {
|
|
|
1820
1826
|
"pre": "장전",
|
|
1821
1827
|
"post": "장후",
|
|
1822
1828
|
"closed": "휴장",
|
|
1829
|
+
// ── Pro: the first weeks' row and the paid cancel ──────────
|
|
1830
|
+
"Try Pro on your tickers": "내 종목으로 Pro 써보기",
|
|
1831
|
+
"Try Pro": "Pro 써보기",
|
|
1832
|
+
"Stop suggesting Pro functions": "Pro 기능 추천 그만 보기",
|
|
1833
|
+
"Open {command}": "{command} 열기",
|
|
1834
|
+
"Options flow": "옵션 플로우",
|
|
1835
|
+
"X mentions": "X 언급",
|
|
1836
|
+
"Hiring": "채용",
|
|
1837
|
+
"8-K events": "8-K 이벤트",
|
|
1838
|
+
"Risk factors": "위험 요인",
|
|
1839
|
+
"Cancel Pro": "Pro 해지",
|
|
1840
|
+
"Cancel Pro?": "Pro를 해지할까요?",
|
|
1841
|
+
"Keep Pro": "Pro 유지",
|
|
1842
|
+
"Pro until {date}": "Pro ({date}까지)",
|
|
1843
|
+
"Cancelling...": "해지 중...",
|
|
1844
|
+
"Cancel Subscription": "구독 해지",
|
|
1845
|
+
"Keep My Subscription": "구독 유지",
|
|
1846
|
+
"Continue Cancellation": "계속 해지",
|
|
1847
|
+
"Pro stays on until {date}.": "Pro는 {date}까지 유지됩니다.",
|
|
1848
|
+
"Pro stays on until {date}. Cancelling now stops the renewal after that date.": "Pro는 {date}까지 유지됩니다. 지금 해지하면 그 날짜 이후 갱신되지 않습니다.",
|
|
1849
|
+
"Cancelled. Pro stays on until {date}.": "해지되었습니다. Pro는 {date}까지 유지됩니다.",
|
|
1823
1850
|
};
|
package/src/i18n/zh-cn.ts
CHANGED
|
@@ -1612,6 +1612,12 @@ export const zhCN: Record<string, string> = {
|
|
|
1612
1612
|
"TICKERS": "标的",
|
|
1613
1613
|
"Which tickers do you follow?": "你关注哪些标的?",
|
|
1614
1614
|
"Pick up to 3 for your watchlist.": "最多选 3 个加入自选列表。",
|
|
1615
|
+
// "Where did you hear about Gloom?", once, after an account signs up
|
|
1616
|
+
"Where did you hear about Gloom?": "你是从哪里知道 Gloom 的?",
|
|
1617
|
+
"AI assistant": "AI 助手",
|
|
1618
|
+
"Friend or colleague": "朋友或同事",
|
|
1619
|
+
"Article or newsletter": "文章或新闻通讯",
|
|
1620
|
+
"Where?": "在哪里?",
|
|
1615
1621
|
"Skip": "跳过",
|
|
1616
1622
|
"Equities": "股票",
|
|
1617
1623
|
"Futures & commodities": "期货与大宗商品",
|
|
@@ -1822,4 +1828,25 @@ export const zhCN: Record<string, string> = {
|
|
|
1822
1828
|
"pre": "盘前",
|
|
1823
1829
|
"post": "盘后",
|
|
1824
1830
|
"closed": "休市",
|
|
1831
|
+
// ── Pro: the first weeks' row and the paid cancel ──────────
|
|
1832
|
+
"Try Pro on your tickers": "在你的标的上试试 Pro",
|
|
1833
|
+
"Try Pro": "试试 Pro",
|
|
1834
|
+
"Stop suggesting Pro functions": "不再推荐 Pro 功能",
|
|
1835
|
+
"Open {command}": "打开 {command}",
|
|
1836
|
+
"Options flow": "期权流",
|
|
1837
|
+
"X mentions": "X 提及",
|
|
1838
|
+
"Hiring": "招聘",
|
|
1839
|
+
"8-K events": "8-K 事件",
|
|
1840
|
+
"Risk factors": "风险因素",
|
|
1841
|
+
"Cancel Pro": "取消 Pro",
|
|
1842
|
+
"Cancel Pro?": "取消 Pro?",
|
|
1843
|
+
"Keep Pro": "保留 Pro",
|
|
1844
|
+
"Pro until {date}": "Pro 至 {date}",
|
|
1845
|
+
"Cancelling...": "正在取消...",
|
|
1846
|
+
"Cancel Subscription": "取消订阅",
|
|
1847
|
+
"Keep My Subscription": "保留我的订阅",
|
|
1848
|
+
"Continue Cancellation": "继续取消",
|
|
1849
|
+
"Pro stays on until {date}.": "Pro 将保留至 {date}。",
|
|
1850
|
+
"Pro stays on until {date}. Cancelling now stops the renewal after that date.": "Pro 将保留至 {date}。现在取消会在该日期后停止续订。",
|
|
1851
|
+
"Cancelled. Pro stays on until {date}.": "已取消。Pro 将保留至 {date}。",
|
|
1825
1852
|
};
|
package/src/i18n/zh-tw.ts
CHANGED
|
@@ -1612,6 +1612,12 @@ export const zhTW: Record<string, string> = {
|
|
|
1612
1612
|
"TICKERS": "標的",
|
|
1613
1613
|
"Which tickers do you follow?": "你關注哪些標的?",
|
|
1614
1614
|
"Pick up to 3 for your watchlist.": "最多選 3 個加入自選清單。",
|
|
1615
|
+
// "Where did you hear about Gloom?", once, after an account signs up
|
|
1616
|
+
"Where did you hear about Gloom?": "你是從哪裡知道 Gloom 的?",
|
|
1617
|
+
"AI assistant": "AI 助理",
|
|
1618
|
+
"Friend or colleague": "朋友或同事",
|
|
1619
|
+
"Article or newsletter": "文章或電子報",
|
|
1620
|
+
"Where?": "在哪裡?",
|
|
1615
1621
|
"Skip": "略過",
|
|
1616
1622
|
"Equities": "股票",
|
|
1617
1623
|
"Futures & commodities": "期貨與大宗商品",
|
|
@@ -1822,4 +1828,25 @@ export const zhTW: Record<string, string> = {
|
|
|
1822
1828
|
"pre": "盤前",
|
|
1823
1829
|
"post": "盤後",
|
|
1824
1830
|
"closed": "休市",
|
|
1831
|
+
// ── Pro: the first weeks' row and the paid cancel ──────────
|
|
1832
|
+
"Try Pro on your tickers": "在你的標的上試試 Pro",
|
|
1833
|
+
"Try Pro": "試試 Pro",
|
|
1834
|
+
"Stop suggesting Pro functions": "不再推薦 Pro 功能",
|
|
1835
|
+
"Open {command}": "開啟 {command}",
|
|
1836
|
+
"Options flow": "選擇權流向",
|
|
1837
|
+
"X mentions": "X 提及",
|
|
1838
|
+
"Hiring": "招聘",
|
|
1839
|
+
"8-K events": "8-K 事件",
|
|
1840
|
+
"Risk factors": "風險因素",
|
|
1841
|
+
"Cancel Pro": "取消 Pro",
|
|
1842
|
+
"Cancel Pro?": "取消 Pro?",
|
|
1843
|
+
"Keep Pro": "保留 Pro",
|
|
1844
|
+
"Pro until {date}": "Pro 至 {date}",
|
|
1845
|
+
"Cancelling...": "正在取消...",
|
|
1846
|
+
"Cancel Subscription": "取消訂閱",
|
|
1847
|
+
"Keep My Subscription": "保留我的訂閱",
|
|
1848
|
+
"Continue Cancellation": "繼續取消",
|
|
1849
|
+
"Pro stays on until {date}.": "Pro 將保留至 {date}。",
|
|
1850
|
+
"Pro stays on until {date}. Cancelling now stops the renewal after that date.": "Pro 將保留至 {date}。現在取消會在該日期後停止續訂。",
|
|
1851
|
+
"Cancelled. Pro stays on until {date}.": "已取消。Pro 將保留至 {date}。",
|
|
1825
1852
|
};
|
|
@@ -197,8 +197,8 @@ function DiscoverStatus({ controller }: { controller: LayoutGalleryController })
|
|
|
197
197
|
<EmptyState title="Log in to browse community layouts." />
|
|
198
198
|
{/* The sidebar is narrow, so the pair wraps instead of running under the divider. */}
|
|
199
199
|
<Box flexDirection="row" flexWrap="wrap" gap={1} marginTop={1}>
|
|
200
|
-
<Button label={t("
|
|
201
|
-
<Button label={t("
|
|
200
|
+
<Button label={t("Sign up free")} variant="primary" compact onPress={controller.requestSignUp} />
|
|
201
|
+
<Button label={t("Log in")} variant="secondary" compact onPress={controller.requestSignIn} />
|
|
202
202
|
</Box>
|
|
203
203
|
</SidebarState>
|
|
204
204
|
);
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { IssuerListings } from "../types/issuer-listings";
|
|
2
|
+
import { canonicalExchange, parsePublicTickerKey } from "../utils/exchanges";
|
|
3
|
+
import { hongKongListingCode, listingSuffixCandidate } from "../sources/listing-symbols";
|
|
4
|
+
import { pricesTimingNote, type PairPriceInput } from "./depositary-pair";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A company listed twice in China: its A shares in Shanghai or Shenzhen, in
|
|
8
|
+
* yuan, and its H shares in Hong Kong, in Hong Kong dollars (China Shenhua's
|
|
9
|
+
* 601088:SSE and 1088:HKEX, CATL's 300750:SZSE and 3750:HKEX). The two are
|
|
10
|
+
* one class of the company's shares, so the H price against the A price at
|
|
11
|
+
* spot is the A/H premium a Hong Kong desk quotes: on 17 Nov 2026 CATL's H
|
|
12
|
+
* shares closed at HK$366.80 against CN¥238.50 for its A shares, HK$280.80 at
|
|
13
|
+
* 1.1772 Hong Kong dollars a yuan, the H shares about 31% over the A.
|
|
14
|
+
*/
|
|
15
|
+
export interface AhPair {
|
|
16
|
+
/** The H share line, `1088:HKEX`. */
|
|
17
|
+
h: string;
|
|
18
|
+
/** The A share line, `601088:SSE`. */
|
|
19
|
+
a: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const A_SHARE_VENUES = new Set(["SSE", "SZSE"]);
|
|
23
|
+
|
|
24
|
+
/** A listing of the company universe as a key: `1088:HKEX`, `601088:SSE`. */
|
|
25
|
+
function listingKey(line: { symbol: string; exchange: string }): string {
|
|
26
|
+
const { symbol, exchange } = parsePublicTickerKey(line.symbol);
|
|
27
|
+
const venue = canonicalExchange(exchange ?? line.exchange);
|
|
28
|
+
return `${hongKongListingCode(symbol, venue)}:${venue}`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The A and H lines of the company Gloom Cloud's company universe holds them
|
|
33
|
+
* for: exactly one line in Hong Kong and one in Shanghai or Shenzhen. Null for
|
|
34
|
+
* any other company, and for one with more lines there than one of each.
|
|
35
|
+
*/
|
|
36
|
+
export function ahPairOf(issuer: Pick<IssuerListings, "listings"> | null | undefined): AhPair | null {
|
|
37
|
+
const lines = issuer?.listings ?? [];
|
|
38
|
+
const h = lines.filter((line) => canonicalExchange(line.exchange) === "HKEX");
|
|
39
|
+
const a = lines.filter((line) => A_SHARE_VENUES.has(canonicalExchange(line.exchange)));
|
|
40
|
+
return h.length === 1 && a.length === 1 ? { h: listingKey(h[0]!), a: listingKey(a[0]!) } : null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A listing as the pair writes its lines: `1088:HKEX` for 1088 on HKEX,
|
|
45
|
+
* `1088.HK` or `1088:HKEX`, the venue read from the key, a vendor's suffix or
|
|
46
|
+
* `exchange`.
|
|
47
|
+
*/
|
|
48
|
+
export function ahListingKey(symbol: string, exchange?: string | null): string {
|
|
49
|
+
const parsed = parsePublicTickerKey(symbol);
|
|
50
|
+
const suffixed = parsed.exchange ? null : listingSuffixCandidate(parsed.symbol);
|
|
51
|
+
return listingKey({ symbol: suffixed?.symbol ?? parsed.symbol, exchange: canonicalExchange(parsed.exchange ?? suffixed?.exchange ?? exchange ?? "") });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Which line of the pair a listing is (`ahListingKey`); null for neither. */
|
|
55
|
+
export function ahPairSide(pair: AhPair, symbol: string, exchange?: string | null): "h" | "a" | null {
|
|
56
|
+
const key = ahListingKey(symbol, exchange);
|
|
57
|
+
return key === pair.h ? "h" : key === pair.a ? "a" : null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Hong Kong dollars a yuan, from each currency's dollar value as exchange rates are served, and when it was read. */
|
|
61
|
+
export interface AhSpot {
|
|
62
|
+
rate: number;
|
|
63
|
+
observedAt: number | null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The rate from each currency's US dollar value (dollars a unit), as exchange
|
|
68
|
+
* rates are served and observed (`asOf`), dated by the older of the two reads.
|
|
69
|
+
* Null without both.
|
|
70
|
+
*/
|
|
71
|
+
export function ahSpotFromUsdValues(
|
|
72
|
+
cny: { rate: number | null | undefined; asOf?: number | null } | null | undefined,
|
|
73
|
+
hkd: { rate: number | null | undefined; asOf?: number | null } | null | undefined,
|
|
74
|
+
): AhSpot | null {
|
|
75
|
+
const yuan = cny?.rate;
|
|
76
|
+
const dollar = hkd?.rate;
|
|
77
|
+
if (yuan == null || dollar == null || !(yuan > 0) || !(dollar > 0) || !Number.isFinite(yuan / dollar)) return null;
|
|
78
|
+
const times = [cny?.asOf, hkd?.asOf].filter((time): time is number => time != null && Number.isFinite(time));
|
|
79
|
+
return { rate: yuan / dollar, observedAt: times.length === 2 ? Math.min(...times) : null };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface AhComparison {
|
|
83
|
+
h: PairPriceInput;
|
|
84
|
+
a: PairPriceInput;
|
|
85
|
+
spot: AhSpot | null;
|
|
86
|
+
/** The A price in Hong Kong dollars at spot. */
|
|
87
|
+
aInHkd: number | null;
|
|
88
|
+
/** The H price over the A price at spot, in percent: H / (A × spot) - 1. */
|
|
89
|
+
premiumPercent: number | null;
|
|
90
|
+
/** Said when the two prices were not set together; null when they were. */
|
|
91
|
+
timingNote: string | null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The comparison, or null without both prices, each in its own currency (HKD and CNY). */
|
|
95
|
+
export function compareAhPair(h: PairPriceInput | null, a: PairPriceInput | null, spot: AhSpot | null, now = Date.now()): AhComparison | null {
|
|
96
|
+
if (!h || !a || h.currency !== "HKD" || a.currency !== "CNY") return null;
|
|
97
|
+
const aInHkd = spot ? a.price * spot.rate : null;
|
|
98
|
+
const premiumPercent = aInHkd != null && aInHkd > 0 ? (h.price / aInHkd - 1) * 100 : null;
|
|
99
|
+
return { h, a, spot, aInHkd, premiumPercent, timingNote: pricesTimingNote(a, h, now) };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** `CNY/HKD`: Hong Kong dollars a yuan, as `fx` names the pair. */
|
|
103
|
+
export const AH_SPOT_LABEL = "CNY/HKD";
|
|
@@ -156,7 +156,11 @@ export function pairTimeText(time: number, now = Date.now()): string {
|
|
|
156
156
|
return `${formatUtcDayTime({ time, dateOnly: false }, now)} UTC`;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
/**
|
|
160
|
+
* Said when two prices compared were not set together (one market closed, or
|
|
161
|
+
* both closed half an hour or more apart); null when they were.
|
|
162
|
+
*/
|
|
163
|
+
export function pricesTimingNote(receipt: PairPriceInput, home: PairPriceInput, now: number): string | null {
|
|
160
164
|
if (receipt.open && home.open) return null;
|
|
161
165
|
if (receipt.observedAt == null || home.observedAt == null) return null;
|
|
162
166
|
const gap = Math.abs(receipt.observedAt - home.observedAt);
|
|
@@ -181,7 +185,7 @@ export function compareDepositaryPair(
|
|
|
181
185
|
const impliedFx = (home.price * ratio) / receipt.price;
|
|
182
186
|
if (!Number.isFinite(impliedFx) || impliedFx <= 0) return null;
|
|
183
187
|
const premiumPercent = spot ? (spot.rate / impliedFx - 1) * 100 : null;
|
|
184
|
-
return { ratio, receipt, home, impliedFx, spot, premiumPercent, timingNote:
|
|
188
|
+
return { ratio, receipt, home, impliedFx, spot, premiumPercent, timingNote: pricesTimingNote(receipt, home, now) };
|
|
185
189
|
}
|
|
186
190
|
|
|
187
191
|
/** `1,651.28`, `28.4942`, `0.890625`: a dollar rate to its useful digits. */
|
|
@@ -26,8 +26,8 @@ import {
|
|
|
26
26
|
} from "./selectors";
|
|
27
27
|
import { instrumentIdentityKey } from "../utils/instrument-identity";
|
|
28
28
|
import { createBaselineChartRequest } from "./coordinator/chart";
|
|
29
|
-
import { fateListing, LATE_CHANGE_WAIT_MS, listingFateGate, type ListingFateGate } from "../tickers/listing-fate";
|
|
30
|
-
import type
|
|
29
|
+
import { fateListing, LATE_CHANGE_WAIT_MS, listingChangeLine, listingFateGate, tradingListing, type ListingFateGate } from "../tickers/listing-fate";
|
|
30
|
+
import { describeFormerIssuer, describeTickerChange, type TickerChangeLookup } from "../tickers/ticker-changes";
|
|
31
31
|
import type { TickerChanges } from "../types/ticker-changes";
|
|
32
32
|
|
|
33
33
|
const TICKER_FINANCIALS_LOAD_DELAY_MS = 250;
|
|
@@ -425,6 +425,37 @@ export function useListingFateGate(symbol: string | null | undefined, ticker: Ti
|
|
|
425
425
|
return waiting && expired === instrumentKey ? SERVE_GATE : gate;
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
+
/**
|
|
429
|
+
* What `quote` says beside a symbol whose company left it while something
|
|
430
|
+
* else lists there now ("FB now lists ProShares S&P 500 Dynamic Buffer ETF;
|
|
431
|
+
* FB was Meta Platforms before, now META (changed 2022-06-09)"), or whose
|
|
432
|
+
* company merged into another, for a pane that shows the listing there now.
|
|
433
|
+
* Null for a symbol nothing became of, and until its changes are read.
|
|
434
|
+
*/
|
|
435
|
+
export function useTickerChangeNote(symbol: string | null | undefined, ticker: TickerRecord | null | undefined, quote: Quote | null | undefined): string | null {
|
|
436
|
+
const coordinator = getSharedMarketDataCoordinator();
|
|
437
|
+
const instrument = useTickerInstrument(symbol, ticker);
|
|
438
|
+
const instrumentKey = instrument ? instrumentIdentityKey(instrument) : null;
|
|
439
|
+
const listing = useMemo(() => (instrument ? fateListing(instrument) : null), [instrumentKey]);
|
|
440
|
+
const lookup = useMemo(
|
|
441
|
+
() => (coordinator && instrument && listing ? coordinator.lookupTickerChanges(instrument) : null),
|
|
442
|
+
[coordinator, instrumentKey],
|
|
443
|
+
);
|
|
444
|
+
const [answer, setAnswer] = useState<{ lookup: TickerChangeLookup; changes: TickerChanges | null } | null>(null);
|
|
445
|
+
const changes = !lookup ? null : answer?.lookup === lookup ? answer.changes : lookup.peek();
|
|
446
|
+
useEffect(() => {
|
|
447
|
+
if (!lookup || lookup.peek() !== undefined) return;
|
|
448
|
+
let current = true;
|
|
449
|
+
lookup.settle(LATE_CHANGE_WAIT_MS).then((value) => {
|
|
450
|
+
if (current) setAnswer({ lookup, changes: value });
|
|
451
|
+
}, logFailure("market-data.hooks", "Read a symbol's ticker changes failed"));
|
|
452
|
+
return () => { current = false; };
|
|
453
|
+
}, [lookup]);
|
|
454
|
+
if (!listing || !changes) return null;
|
|
455
|
+
const now = tradingListing(quote);
|
|
456
|
+
return listingChangeLine({ change: describeTickerChange(listing.symbol, changes, now), formerIssuer: describeFormerIssuer(listing.symbol, changes, now) });
|
|
457
|
+
}
|
|
458
|
+
|
|
428
459
|
/**
|
|
429
460
|
* Observe quote entries already populated by the shared stream without issuing
|
|
430
461
|
* one HTTP snapshot request per instrument.
|
|
@@ -435,7 +435,8 @@ export function combinedChangeBasisLabel(bases: Iterable<QuoteChangeBasis | null
|
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
/** An extended session as a day's move names its print in words, where there is room: "after hours vs Tue 10 Nov close". */
|
|
438
|
-
|
|
438
|
+
/** An extended session in a sentence: "the move after hours vs Tue 10 Nov close", "Last price 158.78 after hours". */
|
|
439
|
+
export const EXTENDED_PRINT_WORDS: Record<ExtendedSession, string> = { PRE: "pre-market", POST: "after hours", OVERNIGHT: "overnight" };
|
|
439
440
|
|
|
440
441
|
/**
|
|
441
442
|
* The basis of a day's move summed over the prices a book is valued at, when
|
|
@@ -152,3 +152,14 @@ export function sanitizeHeaderMarketChoice(value: unknown): HeaderMarketChoice |
|
|
|
152
152
|
const exchange = typeof value.exchange === "string" ? value.exchange.trim() : "";
|
|
153
153
|
return exchange ? { symbol, exchange } : { symbol };
|
|
154
154
|
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The venue of the market the user works in, as the header shows it: a
|
|
158
|
+
* benchmark's (HKEX for the Hang Seng), or a listing's own exchange. Search
|
|
159
|
+
* leads with this venue's line of the company a word names
|
|
160
|
+
* (`withHomeVenueLead`). Null when the header names no venue.
|
|
161
|
+
*/
|
|
162
|
+
export function homeMarketVenue(choice: HeaderMarketChoice | undefined, timeZone: string | null | undefined): string | null {
|
|
163
|
+
const target = resolveHeaderMarket(choice, timeZone);
|
|
164
|
+
return target.venue ?? (target.exchange || null);
|
|
165
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SplitAction } from "../types/financials";
|
|
2
|
+
|
|
3
|
+
/** A factor with more shares than this on either side is no share count a split states: GE's 1253:1000 spinoff adjustment. */
|
|
4
|
+
const MAX_SPLIT_SHARES = 100;
|
|
5
|
+
|
|
6
|
+
function greatestCommonDivisor(a: number, b: number): number {
|
|
7
|
+
return b === 0 ? a : greatestCommonDivisor(b, a % b);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A split's share terms, from its adjustment factor when that is a ratio of
|
|
12
|
+
* whole share counts: "10-for-1", "1-for-10 reverse", and, for one that adds
|
|
13
|
+
* a share for every few held as a bonus issue does (DBS's 1-for-10 in 2024),
|
|
14
|
+
* "11-for-10, 1 new share for every 10 held". Null for a factor no share count
|
|
15
|
+
* states, which may be a spinoff's price adjustment rather than a split.
|
|
16
|
+
*/
|
|
17
|
+
export function splitShareTerms(split: Pick<SplitAction, "fromFactor" | "toFactor">): string | null {
|
|
18
|
+
const { fromFactor: from, toFactor: to } = split;
|
|
19
|
+
if (!Number.isInteger(from) || !Number.isInteger(to) || from! <= 0 || to! <= 0 || from === to) return null;
|
|
20
|
+
const divisor = greatestCommonDivisor(to!, from!);
|
|
21
|
+
const after = to! / divisor;
|
|
22
|
+
const before = from! / divisor;
|
|
23
|
+
if (Math.max(after, before) > MAX_SPLIT_SHARES) return null;
|
|
24
|
+
if (after < before) return `${after}-for-${before} reverse`;
|
|
25
|
+
if (before === 1) return `${after}-for-1`;
|
|
26
|
+
const added = after - before;
|
|
27
|
+
return `${after}-for-${before}, ${added} new share${added === 1 ? "" : "s"} for every ${before} held`;
|
|
28
|
+
}
|
|
@@ -15,7 +15,7 @@ export function useAccountManagementFooter({
|
|
|
15
15
|
message,
|
|
16
16
|
saveProfile,
|
|
17
17
|
}: {
|
|
18
|
-
busy: "profile" | "password" | "alerts" | "billing" | "trial" | "delete" | null;
|
|
18
|
+
busy: "profile" | "password" | "alerts" | "billing" | "trial" | "cancel" | "delete" | null;
|
|
19
19
|
/** Off while a tab that owns its footer is showing. */
|
|
20
20
|
enabled: boolean;
|
|
21
21
|
hasSession: boolean;
|
|
@@ -3,6 +3,7 @@ import { useFieldRing, type FieldRing } from "../../../components";
|
|
|
3
3
|
import { useShortcut } from "../../../react/input";
|
|
4
4
|
import type { ScrollBoxRenderable } from "../../../ui";
|
|
5
5
|
import { isPlainKey } from "../../../utils/keyboard";
|
|
6
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
6
7
|
import type { AccountDraft, AccountFieldKey } from "./model";
|
|
7
8
|
|
|
8
9
|
const SCOPE = "account-management:fields";
|
|
@@ -35,6 +36,7 @@ export function useAccountManagementKeyboard({
|
|
|
35
36
|
setDraftValue,
|
|
36
37
|
deleteAccount,
|
|
37
38
|
endTrial,
|
|
39
|
+
cancelPro,
|
|
38
40
|
copyInvite,
|
|
39
41
|
turnOffEmailAlerts,
|
|
40
42
|
yearlyPlanAction,
|
|
@@ -57,6 +59,7 @@ export function useAccountManagementKeyboard({
|
|
|
57
59
|
setDraftValue: <K extends keyof AccountDraft>(key: K, value: AccountDraft[K]) => void;
|
|
58
60
|
deleteAccount: () => Promise<void>;
|
|
59
61
|
endTrial: () => Promise<void>;
|
|
62
|
+
cancelPro: () => Promise<void>;
|
|
60
63
|
copyInvite: () => void;
|
|
61
64
|
turnOffEmailAlerts: () => Promise<void>;
|
|
62
65
|
/** The yearly row's action: review, pay or open the invoice. */
|
|
@@ -70,6 +73,7 @@ export function useAccountManagementKeyboard({
|
|
|
70
73
|
passwordAction: openPasswordDialog,
|
|
71
74
|
upgradeAction: openUpgrade,
|
|
72
75
|
cancelTrialAction: () => { void endTrial(); },
|
|
76
|
+
cancelProAction: () => { cancelPro().catch(logFailure("account-management.keyboard", "Cancel Pro failed")); },
|
|
73
77
|
inviteCopyAction: copyInvite,
|
|
74
78
|
assistantsAction: openAssistants,
|
|
75
79
|
deleteAccountAction: () => { void deleteAccount(); },
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import { useAppSelector, usePaneAppConfig } from "../../../state/app/context";
|
|
17
17
|
import { useViewport } from "../../../react/input";
|
|
18
18
|
import { displayWidth } from "../../../utils/format";
|
|
19
|
+
import { formatShortDate } from "../../../utils/datetime-format";
|
|
19
20
|
import { useChartQueries, useFxRatesMap } from "../../../market-data/hooks";
|
|
20
21
|
import { buildPortfolioFinancialsMap } from "../../../market-data/portfolio-financials";
|
|
21
22
|
import { useLiveTickerFinancialsMap, useSampledValue } from "../../../state/hooks/live-ticker-financials";
|
|
@@ -72,6 +73,7 @@ import {
|
|
|
72
73
|
import { DeleteAccountPasswordDialog, PasswordChangeDialog } from "./password-dialog";
|
|
73
74
|
import { deleteAccountConfirmingSession } from "./delete-account";
|
|
74
75
|
import { endTrialAfterWarning } from "./trial-cancel";
|
|
76
|
+
import { cancelProAfterSteps } from "./pro-cancel";
|
|
75
77
|
import { CalendarAccountTab } from "./calendar-tab";
|
|
76
78
|
import { InviteRow } from "./invite-row";
|
|
77
79
|
import { PaymentRecoveryRow, usePaymentRecovery } from "./payment-recovery-row";
|
|
@@ -97,7 +99,7 @@ import { useCloudUpgradeAction } from "../shared/cloud-upgrade";
|
|
|
97
99
|
import { resolvePlanAccess } from "../../../api-client/plan-access";
|
|
98
100
|
import { usePluginPaneState } from "../../runtime";
|
|
99
101
|
|
|
100
|
-
type AccountBusy = "profile" | "password" | "alerts" | "billing" | "trial" | "delete" | null;
|
|
102
|
+
type AccountBusy = "profile" | "password" | "alerts" | "billing" | "trial" | "cancel" | "delete" | null;
|
|
101
103
|
const ACCOUNT_TAB_DEFS: Array<{ label: string; value: AccountManagementTab }> = [
|
|
102
104
|
{ label: "Profile", value: "profile" },
|
|
103
105
|
{ label: "Emails", value: "emails" },
|
|
@@ -132,9 +134,10 @@ const ACCOUNT_TAB_FIELD_ORDER: Record<AccountManagementTab, AccountFieldKey[]> =
|
|
|
132
134
|
],
|
|
133
135
|
// Its actions are footer hints; the tab owns its footer.
|
|
134
136
|
calendar: [],
|
|
135
|
-
// Cancel Trial shows only while a trial runs,
|
|
136
|
-
//
|
|
137
|
-
|
|
137
|
+
// Cancel Trial shows only while a trial runs, Cancel Pro while a paid plan
|
|
138
|
+
// renews, the yearly row while it has an action, Not Now while its review
|
|
139
|
+
// is open, the invite once it loaded.
|
|
140
|
+
pro: ["upgradeAction", "cancelTrialAction", "cancelProAction", "yearlyPlanAction", "yearlyPlanDismissAction", "inviteCopyAction"],
|
|
138
141
|
// The Teams tab owns its own keyboard handling (a list, not form fields).
|
|
139
142
|
teams: [],
|
|
140
143
|
// Remote assistants allowed to drive this terminal; a list with its own footer.
|
|
@@ -290,23 +293,39 @@ export function AccountManagementPane({ focused, width, height }: PaneProps) {
|
|
|
290
293
|
refreshAfterYearlySwitch,
|
|
291
294
|
focusYearlyDismiss,
|
|
292
295
|
);
|
|
296
|
+
// The account's own paid plan, renewing: gloom.sh's cancel window shows then
|
|
297
|
+
// too. A trial has Cancel Trial, Pro through a team is the team's to cancel,
|
|
298
|
+
// and a failed payment shows Pay Invoice in this place.
|
|
299
|
+
const ownSubscription = paymentRecovery.plan?.subscription;
|
|
300
|
+
const canCancelPro = planAccess.isPayingPro
|
|
301
|
+
&& ownSubscription?.active === true
|
|
302
|
+
&& ownSubscription.status !== "trialing"
|
|
303
|
+
&& ownSubscription.cancelAtPeriodEnd !== true
|
|
304
|
+
&& !paymentRecovery.visible;
|
|
293
305
|
const fieldOrder = useMemo(() => ACCOUNT_TAB_FIELD_ORDER[activeTab].filter((field) => {
|
|
294
306
|
if (field === "showLocalTime" || field === "showDesks") return chatCardSupported;
|
|
295
307
|
if (field === "desks") return chatCardSupported && draft.showDesks;
|
|
296
308
|
if (field === "cancelTrialAction") return planAccess.isTrialActive;
|
|
309
|
+
if (field === "cancelProAction") return canCancelPro;
|
|
297
310
|
if (field === "yearlyPlanAction") return yearlyPlan.primary !== null;
|
|
298
311
|
if (field === "yearlyPlanDismissAction") return yearlyPlan.reviewing;
|
|
299
312
|
if (field === "inviteCopyAction") return invite !== null;
|
|
300
313
|
return true;
|
|
301
|
-
}), [activeTab, chatCardSupported, draft.showDesks, invite, planAccess.isTrialActive, yearlyPlan.primary, yearlyPlan.reviewing]);
|
|
314
|
+
}), [activeTab, canCancelPro, chatCardSupported, draft.showDesks, invite, planAccess.isTrialActive, yearlyPlan.primary, yearlyPlan.reviewing]);
|
|
302
315
|
const accountTabs = ACCOUNT_TAB_DEFS.map((tab) => ({ ...tab, label: t(tab.label) }));
|
|
303
316
|
|
|
304
317
|
const planPrice = useMemo(() => formatCloudMonthlyPrice(pricing), [language, pricing]);
|
|
305
318
|
const trialOffer = useMemo(() => formatTrialOffer(pricing), [language, pricing]);
|
|
319
|
+
const cancelsOn = ownSubscription?.cancelAtPeriodEnd === true && ownSubscription.currentPeriodEnd
|
|
320
|
+
? formatShortDate(ownSubscription.currentPeriodEnd, { fallback: "" })
|
|
321
|
+
: "";
|
|
306
322
|
const planStatusLabel = useMemo(() => {
|
|
307
323
|
const trialEnd = planAccess.isTrialActive ? formatTrialEnd(planAccess.trialEndsAt) : null;
|
|
308
|
-
|
|
309
|
-
|
|
324
|
+
if (trialEnd) return tf("Pro trial — ends {date}", { date: trialEnd });
|
|
325
|
+
// A cancelled paid plan says when Pro stops, where Cancel Pro was.
|
|
326
|
+
if (planAccess.isPayingPro && cancelsOn) return tf("Pro until {date}", { date: cancelsOn });
|
|
327
|
+
return formatPlan(profile?.plan);
|
|
328
|
+
}, [cancelsOn, language, planAccess.isPayingPro, planAccess.isTrialActive, planAccess.trialEndsAt, profile?.plan]);
|
|
310
329
|
|
|
311
330
|
const planStats = useMemo<StatItem[]>(() => {
|
|
312
331
|
return [
|
|
@@ -837,6 +856,43 @@ export function AccountManagementPane({ focused, width, height }: PaneProps) {
|
|
|
837
856
|
}
|
|
838
857
|
}, [busy, dialog, planAccess]);
|
|
839
858
|
|
|
859
|
+
// gloom.sh's cancel window, step for step (pro-cancel.tsx): why, the offer
|
|
860
|
+
// the server has, then the confirmation with the date Pro stays on to.
|
|
861
|
+
const cancelPro = useCallback(async () => {
|
|
862
|
+
setActiveField("cancelProAction");
|
|
863
|
+
if (busy || !canCancelPro) return;
|
|
864
|
+
try {
|
|
865
|
+
const outcome = await cancelProAfterSteps(
|
|
866
|
+
dialog,
|
|
867
|
+
{ currentPeriodEnd: ownSubscription?.currentPeriodEnd },
|
|
868
|
+
{
|
|
869
|
+
retentionOffer: (signal) => apiClient.getCloudRetentionOffer({ signal }),
|
|
870
|
+
acceptOffer: (feedback) => apiClient.acceptCloudRetentionOffer(feedback),
|
|
871
|
+
cancel: (feedback) => apiClient.cancelCloudSubscription(feedback),
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
onWorking: (text) => {
|
|
875
|
+
setBusy("cancel");
|
|
876
|
+
setMessage({ tone: "info", text });
|
|
877
|
+
},
|
|
878
|
+
},
|
|
879
|
+
);
|
|
880
|
+
if (!outcome) return;
|
|
881
|
+
setMessage({ tone: "success", text: outcome.message });
|
|
882
|
+
// The plan changed on the server: Cancel Pro and the plan line follow it.
|
|
883
|
+
await paymentRecovery.reload();
|
|
884
|
+
const nextProfile = await apiClient.getAccountProfile().catch(logFailure("account-management.pane", "Refresh cancelled account profile failed", null));
|
|
885
|
+
if (nextProfile) setProfile(nextProfile);
|
|
886
|
+
} catch (error) {
|
|
887
|
+
setMessage({
|
|
888
|
+
tone: "error",
|
|
889
|
+
text: error instanceof Error ? error.message : t("Cancel failed."),
|
|
890
|
+
});
|
|
891
|
+
} finally {
|
|
892
|
+
setBusy(null);
|
|
893
|
+
}
|
|
894
|
+
}, [busy, canCancelPro, dialog, ownSubscription?.currentPeriodEnd, paymentRecovery.reload]);
|
|
895
|
+
|
|
840
896
|
const renderer = useRendererHost();
|
|
841
897
|
const copyInvite = useCallback(() => {
|
|
842
898
|
setActiveField("inviteCopyAction");
|
|
@@ -863,6 +919,7 @@ export function AccountManagementPane({ focused, width, height }: PaneProps) {
|
|
|
863
919
|
deleteAccount,
|
|
864
920
|
draftRef,
|
|
865
921
|
endTrial,
|
|
922
|
+
cancelPro,
|
|
866
923
|
copyInvite,
|
|
867
924
|
fieldOrder,
|
|
868
925
|
// Behind the sign-in wall the fields are not there, and Enter is the wall's.
|
|
@@ -1137,6 +1194,17 @@ export function AccountManagementPane({ focused, width, height }: PaneProps) {
|
|
|
1137
1194
|
/>
|
|
1138
1195
|
</Box>
|
|
1139
1196
|
) : null}
|
|
1197
|
+
{canCancelPro || busy === "cancel" ? (
|
|
1198
|
+
<Box ref={fieldNodeRef("cancelProAction")} flexDirection="row">
|
|
1199
|
+
<Button
|
|
1200
|
+
label={busy === "cancel" ? t("Cancelling...") : t("Cancel Pro")}
|
|
1201
|
+
variant="danger"
|
|
1202
|
+
active={activeField === "cancelProAction"}
|
|
1203
|
+
onPress={() => { cancelPro().catch(logFailure("account-management.pane", "Cancel Pro failed")); }}
|
|
1204
|
+
disabled={!!busy}
|
|
1205
|
+
/>
|
|
1206
|
+
</Box>
|
|
1207
|
+
) : null}
|
|
1140
1208
|
</Box>}
|
|
1141
1209
|
{paymentRecovery.visible ? null : (
|
|
1142
1210
|
<YearlyPlanRow
|