gloomberb 0.20.12 → 0.20.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +22 -4
- package/src/account/auth-dialog.tsx +22 -4
- package/src/account/auth-form.tsx +6 -1
- package/src/account/billing.ts +3 -2
- package/src/account/checkout-handoff.tsx +7 -14
- package/src/account/device-signin-dialog.tsx +35 -24
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/crypto-markets.ts +10 -0
- package/src/api-client/errors.ts +3 -1
- package/src/api-client/index.ts +10 -2
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/money-markets.ts +7 -0
- package/src/api-client/request.ts +12 -2
- 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 -34
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/brokers/signed-in/sign-in-dialog.tsx +38 -38
- package/src/cli/commands/market.ts +146 -55
- package/src/cli/commands/overview.ts +21 -7
- 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/errors.ts +3 -1
- package/src/cli/freshness.ts +7 -2
- package/src/cli/glossary.ts +10 -5
- package/src/cli/helpers.ts +8 -16
- package/src/cli/history-export.ts +4 -0
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +11 -2
- package/src/cli/listing-arg.ts +183 -28
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/catalog.ts +81 -12
- 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 +13 -10
- package/src/cli/pane-functions/index.ts +1 -1
- package/src/cli/pane-functions/options.ts +7 -0
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/pane-functions/resolver.ts +61 -15
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +6 -2
- package/src/cli/result.ts +24 -5
- package/src/cli/symbol-args.ts +5 -3
- package/src/cli/symbol-list.ts +23 -10
- package/src/cli/symbol-rows.ts +135 -3
- package/src/cli/treasury-yields.ts +15 -1
- package/src/components/chart/composite/axis-overlays.tsx +5 -2
- package/src/components/chart/composite/composite-chart.tsx +1 -0
- package/src/components/chart/composite/format.ts +103 -16
- package/src/components/chart/composite/legend.tsx +60 -25
- package/src/components/chart/composite/panel-surface/axis-markers.ts +133 -0
- package/src/components/chart/composite/panel-surface/level-labels.tsx +78 -0
- package/src/components/chart/composite/panel-surface/overlays.ts +108 -0
- package/src/components/chart/composite/panel-surface/pan-coast.ts +54 -0
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +138 -0
- package/src/components/chart/composite/panel-surface/panel-levels.ts +47 -0
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +403 -0
- package/src/components/chart/composite/panel-surface/plot-pointer.ts +65 -0
- package/src/components/chart/composite/panel-surface/plot-wheel.ts +102 -0
- package/src/components/chart/composite/panel-surface/pointer.ts +12 -0
- package/src/components/chart/composite/panel-surface/props.ts +79 -0
- package/src/components/chart/composite/panel-surface/tool-readout.ts +151 -0
- package/src/components/chart/composite/panel-surface/value-axis-gestures.ts +152 -0
- package/src/components/chart/composite/panel-surface.tsx +81 -1177
- package/src/components/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/commands/collection-list.ts +1 -0
- 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 +23 -11
- package/src/components/command-bar/routes/root/runtime.ts +3 -2
- package/src/components/command-bar/routes/root/selection.ts +3 -2
- package/src/components/command-bar/routes/root/shortcuts.ts +15 -0
- package/src/components/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/layout/pane/title.ts +10 -4
- 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/pane-settings-dialog/tui.tsx +6 -3
- package/src/components/pane-settings-dialog.tsx +2 -1
- package/src/components/pane-template-wizard.tsx +2 -0
- package/src/components/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 +102 -33
- package/src/components/ui/confirm-dialog.tsx +3 -2
- package/src/components/ui/frame.tsx +7 -3
- package/src/components/ui/icon.tsx +4 -2
- package/src/components/ui/list-view.tsx +8 -0
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/number-prompt-dialog.tsx +2 -1
- package/src/components/ui/query-bar.tsx +16 -4
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/components/use-pane-notice-footer.tsx +3 -1
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +3 -3
- package/src/i18n/es.ts +6 -2
- package/src/i18n/ja.ts +6 -2
- package/src/i18n/ko.ts +6 -2
- package/src/i18n/zh-cn.ts +6 -2
- package/src/i18n/zh-tw.ts +6 -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 +48 -14
- package/src/market-data/quotes/contributions.ts +13 -0
- package/src/market-data/quotes/export-identity.ts +36 -1
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/resolution.ts +16 -0
- 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/account-management/password-dialog.tsx +2 -2
- 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-client.ts +12 -2
- package/src/plugins/builtin/analytics/risk-headless.ts +66 -6
- package/src/plugins/builtin/analytics/risk-math.ts +23 -6
- package/src/plugins/builtin/analytics/risk-model.ts +26 -15
- package/src/plugins/builtin/analytics/risk-pane.tsx +8 -7
- 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/catalog-inventory.ts +5 -2
- package/src/plugins/builtin/chart-composer/editor.tsx +1 -0
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +8 -4
- package/src/plugins/builtin/chart-composer/quick-add.tsx +4 -1
- package/src/plugins/builtin/chart-composer/series-catalog.ts +17 -1
- package/src/plugins/builtin/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/plugin.tsx +2 -0
- 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/thesis/module.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +6 -2
- 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 +10 -4
- package/src/plugins/builtin/cpi/model.ts +25 -7
- package/src/plugins/builtin/cpi/pane.tsx +3 -1
- 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/client.ts +6 -1
- 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/headless.ts +10 -2
- package/src/plugins/builtin/crypto-board/model.ts +93 -14
- package/src/plugins/builtin/crypto-board/pane.tsx +28 -13
- 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 +31 -5
- package/src/plugins/builtin/dividend-yield/headless.ts +20 -13
- 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 +21 -12
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +8 -4
- 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 +22 -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/index.tsx +2 -0
- 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 +19 -3
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/fred-catalog.ts +33 -4
- 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 +25 -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 +27 -15
- package/src/plugins/builtin/macro-day/model.ts +42 -4
- package/src/plugins/builtin/macro-day/pane.tsx +30 -12
- package/src/plugins/builtin/macro-day/releases.ts +24 -1
- 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/client.ts +4 -1
- package/src/plugins/builtin/money-markets/headless.ts +17 -5
- package/src/plugins/builtin/money-markets/index.tsx +1 -1
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +11 -5
- 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/cli/bulk-symbols.ts +4 -2
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +61 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +11 -3
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +2 -0
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/headless.ts +33 -6
- 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/index.tsx +5 -3
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +26 -7
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +16 -1
- 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 +8 -5
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +6 -4
- package/src/plugins/builtin/portfolio-list/table.tsx +25 -15
- 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/cloud-upgrade.ts +4 -2
- package/src/plugins/builtin/shared/cpi-year-gap.ts +67 -0
- 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/headless.ts +45 -2
- 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 +33 -6
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +8 -9
- package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -14
- 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 +43 -9
- 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/collection-name.ts +2 -1
- package/src/portfolio/column-values.ts +61 -45
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/portfolio/listed-symbol.ts +4 -2
- package/src/portfolio/period-pnl.ts +51 -1
- package/src/renderers/dom/dialog-host.tsx +5 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/electrobun/view/remote/capability-invoker.ts +1 -1
- package/src/renderers/opentui/dialog-host.tsx +3 -4
- 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 +7 -0
- package/src/sources/provider-router/history.ts +5 -2
- 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/test-support/plugin-persistence.ts +12 -0
- package/src/tickers/company-name-listing.ts +6 -5
- package/src/tickers/company-name.ts +36 -2
- package/src/tickers/instrument-coverage.ts +27 -0
- package/src/tickers/listing-venues.ts +26 -1
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/home-listing.ts +38 -1
- package/src/tickers/search/index.ts +22 -2
- package/src/tickers/search/ranking.ts +21 -2
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/time-series/base-series.ts +4 -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/time-series/types.ts +5 -2
- package/src/types/config.ts +9 -0
- package/src/types/data-provider.ts +3 -2
- package/src/types/financials.ts +28 -0
- package/src/types/headless.ts +2 -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/ui/dialog-stack.ts +17 -0
- package/src/ui/dialog.tsx +6 -2
- package/src/utils/crypto-pair.ts +9 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/exchanges.ts +13 -0
- package/src/utils/financial-statements.ts +98 -17
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/futures-generic.ts +14 -0
- 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/trailing-dividend.ts +13 -3
- package/src/utils/zoned-date-time.ts +47 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gloomberb",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.14",
|
|
4
4
|
"packageManager": "bun@1.3.14",
|
|
5
5
|
"description": "Market research and portfolio tracker for the terminal",
|
|
6
6
|
"module": "src/public/index.ts",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"check:pane-screenshot": "bun run scripts/pane-chrome/screenshot.ts",
|
|
96
96
|
"check:pane-rest": "bun run scripts/pane-chrome/rest-diff.ts",
|
|
97
97
|
"check:pane-layout": "bun run scripts/pane-chrome/layout-sweep.ts",
|
|
98
|
+
"check:pane-data": "bun run scripts/pane-chrome/data-sweep.ts",
|
|
98
99
|
"check:ui-tokens": "bun run scripts/pane-chrome/ui-tokens.ts",
|
|
99
100
|
"ui:benchmark": "bun run scripts/pane-chrome/ui-benchmark.ts",
|
|
100
101
|
"askg:tool-sweep": "bun run scripts/askg-tool-sweep.ts",
|
|
@@ -539,7 +539,25 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..1f5795ab76800a64fdb0acf4a1ed0186
|
|
|
539
539
|
this._hasPointer = true;
|
|
540
540
|
this._lastPointerModifiers = mouseEvent.modifiers;
|
|
541
541
|
if (this._console.visible) {
|
|
542
|
-
@@ -
|
|
542
|
+
@@ -24327,6 +24557,17 @@ Captured external output:
|
|
543
|
+
const sameElement = maybeRenderableId === this.lastOverRenderableNum;
|
|
544
|
+
this.lastOverRenderableNum = maybeRenderableId;
|
|
545
|
+
const maybeRenderable = Renderable.renderablesByNumber.get(maybeRenderableId);
|
|
546
|
+
+ // A press where the pointer was not last over took it there: some terminals report no motion between presses,
|
|
547
|
+
+ // so what it was over would keep its hover (a chart its crosshair) until the next move.
|
|
548
|
+
+ if (!sameElement && mouseEvent.type === "down" && !this.capturedRenderable && this.lastOverRenderable !== maybeRenderable) {
|
|
549
|
+
+ if (this.lastOverRenderable && !this.lastOverRenderable.isDestroyed) {
|
|
550
|
+
+ this.lastOverRenderable.processMouseEvent(new MouseEvent(this.lastOverRenderable, { ...mouseEvent, type: "out" }));
|
|
551
|
+
+ }
|
|
552
|
+
+ this.lastOverRenderable = maybeRenderable;
|
|
553
|
+
+ if (maybeRenderable) {
|
|
554
|
+
+ maybeRenderable.processMouseEvent(new MouseEvent(maybeRenderable, { ...mouseEvent, type: "over" }));
|
|
555
|
+
+ }
|
|
556
|
+
+ }
|
|
557
|
+
if (mouseEvent.type === "down" && mouseEvent.button === 0 /* LEFT */ && !this.currentSelection?.isDragging && !mouseEvent.modifiers.ctrl) {
|
|
558
|
+
const canStartSelection = Boolean(maybeRenderable && maybeRenderable.selectable && !maybeRenderable.isDestroyed && maybeRenderable.shouldStartSelection(mouseEvent.x, mouseEvent.y));
|
|
559
|
+
if (canStartSelection && maybeRenderable) {
|
|
560
|
+
@@ -24437,6 +24678,8 @@ Captured external output:
|
|
543
561
|
return;
|
|
544
562
|
}
|
|
545
563
|
const baseEvent = {
|
|
@@ -548,7 +566,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..1f5795ab76800a64fdb0acf4a1ed0186
|
|
|
548
566
|
type: "move",
|
|
549
567
|
button: 0,
|
|
550
568
|
x: this._latestPointer.x,
|
|
551
|
-
@@ -24527,6 +
|
|
569
|
+
@@ -24527,6 +24770,7 @@ Captured external output:
|
|
552
570
|
const pendingSplitFooterTransition = this.pendingSplitFooterTransition;
|
|
553
571
|
const previousGeometry = calculateRenderGeometry(this._screenMode, this._terminalWidth, this._terminalHeight, this._footerHeight);
|
|
554
572
|
const prevWidth = this._terminalWidth;
|
|
@@ -556,7 +574,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..1f5795ab76800a64fdb0acf4a1ed0186
|
|
|
556
574
|
const previousTerminalHeight = this._terminalHeight;
|
|
557
575
|
const visiblePreviousSplitHeight = pendingSplitFooterTransition?.sourceHeight ?? previousGeometry.effectiveFooterHeight;
|
|
558
576
|
this._terminalWidth = width;
|
|
559
|
-
@@ -24832,6 +
|
|
577
|
+
@@ -24832,6 +25076,11 @@ Captured external output:
|
|
560
578
|
this.clock.clearTimeout(this.resizeTimeoutId);
|
|
561
579
|
this.resizeTimeoutId = null;
|
|
562
580
|
}
|
|
@@ -568,7 +586,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..1f5795ab76800a64fdb0acf4a1ed0186
|
|
|
568
586
|
if (this.capabilityTimeoutId !== null) {
|
|
569
587
|
this.clock.clearTimeout(this.capabilityTimeoutId);
|
|
570
588
|
this.capabilityTimeoutId = null;
|
|
571
|
-
@@ -24847,6 +
|
|
589
|
+
@@ -24847,6 +25096,7 @@ Captured external output:
|
|
572
590
|
}
|
|
573
591
|
this.themeModeState.cancelRefresh();
|
|
574
592
|
this._isRunning = false;
|
|
@@ -10,30 +10,43 @@ import type { AuthUser } from "../api-client";
|
|
|
10
10
|
import { DialogFrame } from "../components/ui/frame";
|
|
11
11
|
import { useAppLanguage } from "../i18n/react";
|
|
12
12
|
import { useDialog, type PromptContext } from "../ui/dialog";
|
|
13
|
+
import { clickOutsideWhileClean } from "../ui/dialog-stack";
|
|
13
14
|
import { AuthForm, authFormTitle } from "./auth-form";
|
|
14
15
|
import type { AccountMode } from "./auth-model";
|
|
15
16
|
import { CloudVerificationPanel } from "./verification-panel";
|
|
16
17
|
|
|
17
18
|
function AuthDialog({
|
|
18
19
|
initialMode,
|
|
20
|
+
reason,
|
|
19
21
|
resolve,
|
|
20
22
|
dismiss,
|
|
21
|
-
|
|
23
|
+
onCleanChange,
|
|
24
|
+
}: PromptContext<AuthUser | undefined> & {
|
|
25
|
+
initialMode: AccountMode;
|
|
26
|
+
reason?: string;
|
|
27
|
+
onCleanChange: (clean: boolean) => void;
|
|
28
|
+
}) {
|
|
22
29
|
useAppLanguage();
|
|
23
30
|
const [mode, setMode] = useState<AccountMode>(initialMode);
|
|
24
31
|
const [verifyingUser, setVerifyingUser] = useState<AuthUser | null>(null);
|
|
32
|
+
const [typed, setTyped] = useState(false);
|
|
33
|
+
// A click outside closes it only while it is clean: never with something typed, nor once the account
|
|
34
|
+
// waits on its emailed code.
|
|
35
|
+
useEffect(() => onCleanChange(!typed && !verifyingUser), [onCleanChange, typed, verifyingUser]);
|
|
25
36
|
|
|
26
|
-
|
|
37
|
+
// The close button always closes it, so a mouse is never trapped in it.
|
|
38
|
+
if (verifyingUser) return <DialogFrame title={`Confirm ${verifyingUser.email}`} onClose={dismiss}>
|
|
27
39
|
<CloudVerificationPanel onVerified={resolve} onContinueFree={() => resolve(verifyingUser)} />
|
|
28
40
|
</DialogFrame>;
|
|
29
41
|
|
|
30
42
|
return (
|
|
31
|
-
<DialogFrame title={authFormTitle(mode)}>
|
|
43
|
+
<DialogFrame title={authFormTitle(mode)} subtitle={reason} onClose={dismiss}>
|
|
32
44
|
<AuthForm
|
|
33
45
|
initialMode={initialMode}
|
|
34
46
|
onModeChange={setMode}
|
|
35
47
|
onSignedIn={(user) => user.emailVerified ? resolve(user) : setVerifyingUser(user)}
|
|
36
48
|
onEscape={dismiss}
|
|
49
|
+
onTypedChange={setTyped}
|
|
37
50
|
/>
|
|
38
51
|
</DialogFrame>
|
|
39
52
|
);
|
|
@@ -41,6 +54,8 @@ function AuthDialog({
|
|
|
41
54
|
|
|
42
55
|
export interface AuthDialogRequest {
|
|
43
56
|
mode?: AccountMode;
|
|
57
|
+
/** What asked for it, under the title: the delayed mark says what is delayed and by how much. */
|
|
58
|
+
reason?: string;
|
|
44
59
|
onSignedIn?: (user: AuthUser) => void;
|
|
45
60
|
}
|
|
46
61
|
|
|
@@ -77,13 +92,16 @@ export function AuthDialogHost() {
|
|
|
77
92
|
if (openRef.current) return;
|
|
78
93
|
openRef.current = true;
|
|
79
94
|
openAuthDialogs += 1;
|
|
95
|
+
const { closeOnClickOutside, setClean } = clickOutsideWhileClean();
|
|
80
96
|
void dialog
|
|
81
97
|
.prompt<AuthUser | undefined>({
|
|
82
|
-
closeOnClickOutside
|
|
98
|
+
closeOnClickOutside,
|
|
83
99
|
content: (context: unknown) => (
|
|
84
100
|
<AuthDialog
|
|
85
101
|
{...(context as PromptContext<AuthUser | undefined>)}
|
|
86
102
|
initialMode={request.mode ?? "login"}
|
|
103
|
+
reason={request.reason}
|
|
104
|
+
onCleanChange={setClean}
|
|
87
105
|
/>
|
|
88
106
|
),
|
|
89
107
|
})
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* own panel. The sign-in attempt it shares with onboarding lives in
|
|
5
5
|
* `email-auth-attempt`, the non-React logic in `auth-model`.
|
|
6
6
|
*/
|
|
7
|
-
import { useCallback, useRef, useState, type ReactNode } from "react";
|
|
7
|
+
import { useCallback, useEffect, useRef, useState, type ReactNode } from "react";
|
|
8
8
|
import { apiClient, type AuthUser } from "../api-client";
|
|
9
9
|
import { matchesKeyChord, parseKeyChord } from "../app/keybindings";
|
|
10
10
|
import { Button, Spinner, TextField } from "../components";
|
|
@@ -50,6 +50,8 @@ export interface AuthFormProps {
|
|
|
50
50
|
onModeChange?: (mode: AccountMode) => void;
|
|
51
51
|
/** Extra actions below the buttons, e.g. the gate's QR alternative. */
|
|
52
52
|
footer?: ReactNode;
|
|
53
|
+
/** Whether anything is typed in it, so a dialog holding it closes on a stray click only while nothing would be lost. */
|
|
54
|
+
onTypedChange?: (typed: boolean) => void;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
export function AuthForm({
|
|
@@ -59,6 +61,7 @@ export function AuthForm({
|
|
|
59
61
|
shortcutScope,
|
|
60
62
|
onModeChange,
|
|
61
63
|
footer,
|
|
64
|
+
onTypedChange,
|
|
62
65
|
}: AuthFormProps) {
|
|
63
66
|
useAppLanguage();
|
|
64
67
|
// The desktop and the web size the column and let its rows fill it, as the kit's dialogs do.
|
|
@@ -70,6 +73,8 @@ export function AuthForm({
|
|
|
70
73
|
const [activeField, setActiveField] = useState<EmailAuthField>("email");
|
|
71
74
|
const [showPassword, setShowPassword] = useState(false);
|
|
72
75
|
const [resetState, setResetState] = useState<ResetState>("idle");
|
|
76
|
+
const typed = email !== "" || password !== "";
|
|
77
|
+
useEffect(() => onTypedChange?.(typed), [onTypedChange, typed]);
|
|
73
78
|
const emailInputRef = useRef<InputRenderable>(null);
|
|
74
79
|
const passwordInputRef = useRef<InputRenderable>(null);
|
|
75
80
|
const {
|
package/src/account/billing.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { formatShortDate } from "../utils/datetime-format";
|
|
1
2
|
import type { CloudPricing } from "../api-client";
|
|
2
3
|
import { t, tf } from "../i18n";
|
|
3
4
|
|
|
@@ -36,10 +37,10 @@ export function monthsFreeYearly(pricing: CloudPricing | null | undefined): numb
|
|
|
36
37
|
return saved > 0 ? Math.round(saved) : 0;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
/** Short calendar date for the trial countdown, e.g. "Aug
|
|
40
|
+
/** Short calendar date for the trial countdown, e.g. "11 Aug". */
|
|
40
41
|
export function formatTrialEnd(endsAt: Date | null | undefined): string | null {
|
|
41
42
|
if (!endsAt || Number.isNaN(endsAt.getTime())) return null;
|
|
42
|
-
return endsAt
|
|
43
|
+
return formatShortDate(endsAt, { year: false });
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
/**
|
|
@@ -17,7 +17,7 @@ import { t } from "../i18n";
|
|
|
17
17
|
import { useAppLanguage } from "../i18n/react";
|
|
18
18
|
import { useViewport } from "../react/input";
|
|
19
19
|
import { colors } from "../theme/colors";
|
|
20
|
-
import { Box,
|
|
20
|
+
import { Box, useUiCapabilities } from "../ui";
|
|
21
21
|
import { type DialogApi, type PromptContext, useDialogKeyboard } from "../ui/dialog";
|
|
22
22
|
import { logFailure } from "../utils/log-failure";
|
|
23
23
|
import { accountSession } from "./session";
|
|
@@ -187,21 +187,14 @@ function CheckoutHandoffDialog({
|
|
|
187
187
|
);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
// The kit's frame, as every other dialog: its close button is a mouse's way out. A click outside never closes
|
|
191
|
+
// it: from the first moment a checkout is being opened or paid for in the browser.
|
|
190
192
|
return (
|
|
191
|
-
<
|
|
192
|
-
<Box
|
|
193
|
-
|
|
193
|
+
<DialogFrame title={title} subtitle={subtitle} footer={t("esc to close")} onClose={dismiss}>
|
|
194
|
+
<Box flexDirection="column" alignItems="center">
|
|
195
|
+
{panel(termHeight - TERMINAL_DIALOG_ROWS)}
|
|
194
196
|
</Box>
|
|
195
|
-
|
|
196
|
-
<Text fg={colors.textDim}>{subtitle}</Text>
|
|
197
|
-
</Box>
|
|
198
|
-
<Box height={1} />
|
|
199
|
-
{panel(termHeight - TERMINAL_DIALOG_ROWS)}
|
|
200
|
-
<Box height={1} />
|
|
201
|
-
<Box height={1}>
|
|
202
|
-
<Text fg={colors.textMuted}>{t("esc to close")}</Text>
|
|
203
|
-
</Box>
|
|
204
|
-
</Box>
|
|
197
|
+
</DialogFrame>
|
|
205
198
|
);
|
|
206
199
|
}
|
|
207
200
|
|
|
@@ -11,13 +11,15 @@ import { t, tf } from "../i18n";
|
|
|
11
11
|
import { useAppLanguage } from "../i18n/react";
|
|
12
12
|
import { useViewport } from "../react/input";
|
|
13
13
|
import { colors } from "../theme/colors";
|
|
14
|
-
import { Box,
|
|
14
|
+
import { Box, useUiCapabilities } from "../ui";
|
|
15
15
|
import { Button } from "../components/ui/button";
|
|
16
16
|
import { DialogActions } from "../components/ui/dialog-actions";
|
|
17
17
|
import { FORM_DIALOG_WIDTH, DialogFrame } from "../components/ui/frame";
|
|
18
18
|
import { SignInCodePanel } from "../components/sign-in-code-panel";
|
|
19
|
-
import { useDialog, useDialogKeyboard, type PromptContext } from "../ui/dialog";
|
|
19
|
+
import { useDialog, useDialogKeyboard, type DialogApi, type PromptContext } from "../ui/dialog";
|
|
20
|
+
import { clickOutsideWhileClean } from "../ui/dialog-stack";
|
|
20
21
|
import { isPlainKey, type KeyboardModifierEventLike } from "../utils/keyboard";
|
|
22
|
+
import { logFailure } from "../utils/log-failure";
|
|
21
23
|
import { DeviceSignInController, type DeviceSignInSnapshot } from "./device-signin";
|
|
22
24
|
|
|
23
25
|
/** How long the approval stays on screen before `onApproved` moves on. */
|
|
@@ -110,12 +112,22 @@ export function DeviceSignInPanel({
|
|
|
110
112
|
const TERMINAL_DIALOG_ROWS = 12;
|
|
111
113
|
const DESKTOP_DIALOG_ROWS = 10;
|
|
112
114
|
|
|
113
|
-
|
|
115
|
+
/** Whether the person may be acting on the code now: shown and waiting, or approved and about to close. */
|
|
116
|
+
function isDeviceSignInPending(snapshot: Pick<DeviceSignInSnapshot, "phase">): boolean {
|
|
117
|
+
return snapshot.phase === "waiting" || snapshot.phase === "approved";
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function DeviceSignInDialog({ resolve, dismiss, onCleanChange }: PromptContext<AuthUser | undefined> & {
|
|
121
|
+
/** A click outside closes it only while no code is out: never while one may be approved in the browser. */
|
|
122
|
+
onCleanChange?: (clean: boolean) => void;
|
|
123
|
+
}) {
|
|
114
124
|
useAppLanguage();
|
|
115
125
|
const { nativePaneChrome } = useUiCapabilities();
|
|
116
126
|
const { height: termHeight } = useViewport();
|
|
117
127
|
// Closes on approval after a beat so the confirmation is visible; enter skips the wait.
|
|
118
128
|
const { snapshot, retry } = useDeviceSignIn({ onApproved: resolve });
|
|
129
|
+
const pending = isDeviceSignInPending(snapshot);
|
|
130
|
+
useEffect(() => onCleanChange?.(!pending), [onCleanChange, pending]);
|
|
119
131
|
|
|
120
132
|
useDialogKeyboard((event) => {
|
|
121
133
|
event.stopPropagation();
|
|
@@ -147,24 +159,28 @@ export function DeviceSignInDialog({ resolve, dismiss }: PromptContext<AuthUser
|
|
|
147
159
|
);
|
|
148
160
|
}
|
|
149
161
|
|
|
162
|
+
// The kit's frame, as every other dialog: its close button is a mouse's way out.
|
|
150
163
|
return (
|
|
151
|
-
<
|
|
152
|
-
<Box
|
|
153
|
-
<
|
|
154
|
-
</Box>
|
|
155
|
-
<Box height={1}>
|
|
156
|
-
<Text fg={colors.textDim}>{subtitle}</Text>
|
|
157
|
-
</Box>
|
|
158
|
-
<Box height={1} />
|
|
159
|
-
<DeviceSignInPanel snapshot={snapshot} height={Math.max(4, termHeight - TERMINAL_DIALOG_ROWS)} />
|
|
160
|
-
<Box height={1} />
|
|
161
|
-
<Box height={1}>
|
|
162
|
-
<Text fg={colors.textMuted}>{t("r to refresh the code · esc to cancel")}</Text>
|
|
164
|
+
<DialogFrame title={title} subtitle={subtitle} footer={t("r to refresh the code · esc to cancel")} onClose={dismiss}>
|
|
165
|
+
<Box flexDirection="column" alignItems="center">
|
|
166
|
+
<DeviceSignInPanel snapshot={snapshot} height={Math.max(4, termHeight - TERMINAL_DIALOG_ROWS)} />
|
|
163
167
|
</Box>
|
|
164
|
-
</
|
|
168
|
+
</DialogFrame>
|
|
165
169
|
);
|
|
166
170
|
}
|
|
167
171
|
|
|
172
|
+
/** Gloom's device sign-in as a full dialog, closing on a click outside while no code is out. */
|
|
173
|
+
export function promptDeviceSignIn(dialog: DialogApi): Promise<AuthUser | undefined> {
|
|
174
|
+
const { closeOnClickOutside, setClean } = clickOutsideWhileClean();
|
|
175
|
+
return dialog.prompt<AuthUser | undefined>({
|
|
176
|
+
size: "full",
|
|
177
|
+
closeOnClickOutside,
|
|
178
|
+
content: (context: unknown) => (
|
|
179
|
+
<DeviceSignInDialog {...(context as PromptContext<AuthUser | undefined>)} onCleanChange={setClean} />
|
|
180
|
+
),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
168
184
|
export interface DeviceSignInDialogRequest {
|
|
169
185
|
onSignedIn?: (user: AuthUser) => void;
|
|
170
186
|
}
|
|
@@ -186,19 +202,14 @@ export function DeviceSignInDialogHost() {
|
|
|
186
202
|
const listener = (request: DeviceSignInDialogRequest) => {
|
|
187
203
|
if (openRef.current) return;
|
|
188
204
|
openRef.current = true;
|
|
189
|
-
void dialog
|
|
190
|
-
.prompt<AuthUser | undefined>({
|
|
191
|
-
size: "full",
|
|
192
|
-
content: (context: unknown) => (
|
|
193
|
-
<DeviceSignInDialog {...(context as PromptContext<AuthUser | undefined>)} />
|
|
194
|
-
),
|
|
195
|
-
})
|
|
205
|
+
void promptDeviceSignIn(dialog)
|
|
196
206
|
.then((signedInUser) => {
|
|
197
207
|
if (signedInUser) request.onSignedIn?.(signedInUser);
|
|
198
208
|
})
|
|
199
209
|
.finally(() => {
|
|
200
210
|
openRef.current = false;
|
|
201
|
-
})
|
|
211
|
+
})
|
|
212
|
+
.catch(logFailure("account.device-signin-dialog", "Device sign-in dialog failed"));
|
|
202
213
|
};
|
|
203
214
|
dialogRequestListeners.add(listener);
|
|
204
215
|
return () => {
|
|
@@ -164,14 +164,14 @@ function UpgradeDialog({
|
|
|
164
164
|
|
|
165
165
|
useEffect(() => {
|
|
166
166
|
let live = true;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
167
|
+
const show = (loaded: UpgradeOffer) => {
|
|
168
|
+
if (live) setOffer(loaded);
|
|
169
|
+
};
|
|
170
|
+
// A failed request still opens the dialog, with list prices.
|
|
171
|
+
loadOffer().then(show, (error: unknown) => {
|
|
172
|
+
logFailure("account-upgrade", "Upgrade offer request failed")(error);
|
|
173
|
+
show({ pricing: null, trialAvailable: null, paymentFailed: false });
|
|
174
|
+
});
|
|
175
175
|
return () => {
|
|
176
176
|
live = false;
|
|
177
177
|
};
|
|
@@ -28,6 +28,16 @@ interface CryptoDayRange {
|
|
|
28
28
|
highAt: string;
|
|
29
29
|
start: string;
|
|
30
30
|
end: string;
|
|
31
|
+
/**
|
|
32
|
+
* The spot exchanges whose own 24-hour low reached `low`; one of several checked makes the low that exchange's,
|
|
33
|
+
* not the market's. Absent from a server that does not check, or when no exchange could be read.
|
|
34
|
+
*/
|
|
35
|
+
lowVenues?: string[];
|
|
36
|
+
highVenues?: string[];
|
|
37
|
+
/** The exchanges whose own 24-hour range was read beside the composite's. */
|
|
38
|
+
venuesChecked?: string[];
|
|
39
|
+
/** The exchanges' own candles around the extremes are still being read: a later answer names them. */
|
|
40
|
+
venuesPending?: boolean;
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
export interface CryptoMarketAsset {
|
package/src/api-client/errors.ts
CHANGED
|
@@ -165,7 +165,9 @@ export function parseApiErrorMessage(body: string): string {
|
|
|
165
165
|
(value): value is string =>
|
|
166
166
|
typeof value === "string" && value.trim().length > 0,
|
|
167
167
|
);
|
|
168
|
-
|
|
168
|
+
// A route can send the schema's refusal as its message, the same object written out as text.
|
|
169
|
+
const wrapped = parts.length === 1 ? parseApiErrorDetails(parts[0]!) : undefined;
|
|
170
|
+
return (wrapped && validationErrorText(wrapped)) || parts.join(" ") || validationErrorText(record) || NO_MESSAGE;
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
const NO_MESSAGE = "The server returned an error without a message.";
|
package/src/api-client/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getLanguage } from "../i18n";
|
|
1
2
|
import { logFailure } from "../utils/log-failure";
|
|
2
3
|
import {
|
|
3
4
|
isMarketplaceLayoutId,
|
|
@@ -57,6 +58,8 @@ export type {
|
|
|
57
58
|
CrashReportSurface,
|
|
58
59
|
CrashReportsPayload,
|
|
59
60
|
FunctionUsageCount,
|
|
61
|
+
InstallExperimentAnswer,
|
|
62
|
+
InstallExperimentReport,
|
|
60
63
|
UpdateFailureReport,
|
|
61
64
|
UsageCountsPayload,
|
|
62
65
|
UsageCountsSurface,
|
|
@@ -572,10 +575,14 @@ class GloomApiClient {
|
|
|
572
575
|
/**
|
|
573
576
|
* Creates a Stripe checkout session for Cloud Pro; the URL opens in a browser.
|
|
574
577
|
* `link` is a short link to the same checkout, to read or scan on another
|
|
575
|
-
* device. Older servers send none.
|
|
578
|
+
* device. Older servers send none. `lang` is the app's language, for the
|
|
579
|
+
* text the server adds to the checkout page.
|
|
576
580
|
*/
|
|
577
581
|
async createCloudCheckout(returnTo?: string, interval: "month" | "year" = "month"): Promise<{ url: string; link?: string }> {
|
|
578
|
-
return this.request<{ url: string; link?: string }>("/stripe/checkout", {
|
|
582
|
+
return this.request<{ url: string; link?: string }>("/stripe/checkout", {
|
|
583
|
+
method: "POST",
|
|
584
|
+
body: JSON.stringify({ returnTo, interval, lang: getLanguage() }),
|
|
585
|
+
});
|
|
579
586
|
}
|
|
580
587
|
|
|
581
588
|
async recordResearchActivity(payload: {
|
|
@@ -926,6 +933,7 @@ class GloomApiClient {
|
|
|
926
933
|
setRoadmapVote = this.roadmap.setRoadmapVote.bind(this.roadmap);
|
|
927
934
|
reportCrashErrors = this.telemetry.reportCrashErrors.bind(this.telemetry);
|
|
928
935
|
reportUsageCounts = this.telemetry.reportUsageCounts.bind(this.telemetry);
|
|
936
|
+
reportInstallExperiment = this.telemetry.reportInstallExperiment.bind(this.telemetry);
|
|
929
937
|
reportAttentionCounts = this.telemetry.reportAttentionCounts.bind(this.telemetry);
|
|
930
938
|
deleteCloudNote = this.notes.deleteNote.bind(this.notes);
|
|
931
939
|
listTheses = this.theses.listTheses.bind(this.theses);
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A/B experiments on an app install: the terminal and the desktop app alike,
|
|
3
|
+
* by the random install id their usage counts carry.
|
|
4
|
+
*
|
|
5
|
+
* The registry and the bucketing live with the Gloom Cloud API, as they do for
|
|
6
|
+
* the web terminal's experiments (web-experiments.ts). The app asks for its
|
|
7
|
+
* arm at the moment an experiment's change would show, in every arm
|
|
8
|
+
* (`experiment_assign`, which the API records nothing for), and once it has
|
|
9
|
+
* gone on with that arm it confirms it (`experiment_exposed`). The
|
|
10
|
+
* confirmation is the exposure, counted under `install:<id>`, the id its
|
|
11
|
+
* usage counts already go under, so what the install does on later days
|
|
12
|
+
* reads against the arm it saw. Turning an experiment off there takes effect
|
|
13
|
+
* here without a release.
|
|
14
|
+
*
|
|
15
|
+
* It is covered by the Usage setting and sends nothing with it off, under
|
|
16
|
+
* Do Not Track or Global Privacy Control, or in an automated browser: those
|
|
17
|
+
* installs get the control and are not counted. An answer that fails or
|
|
18
|
+
* comes too late gets the control too, so the change never holds anything
|
|
19
|
+
* up, and confirms nothing: an install never counts in an arm it did not see.
|
|
20
|
+
*/
|
|
21
|
+
import { apiClient, type InstallExperimentAnswer, type InstallExperimentReport } from "./index";
|
|
22
|
+
import { VERSION } from "../version";
|
|
23
|
+
import { logFailure } from "../utils/log-failure";
|
|
24
|
+
import { usageInstall, type UsageInstall } from "../telemetry/usage-counts";
|
|
25
|
+
import { browserDoNotTrack } from "../telemetry/crash-reports-dom";
|
|
26
|
+
|
|
27
|
+
/** "Which tickers do you follow?" on the first run: `tickers` shows the step, `control` is today's first run. */
|
|
28
|
+
const FIRST_RUN_TICKERS_EXPERIMENT = "first_run_tickers";
|
|
29
|
+
export type FirstRunTickersArm = "control" | "tickers";
|
|
30
|
+
const FIRST_RUN_TICKERS_ARMS: readonly FirstRunTickersArm[] = ["control", "tickers"];
|
|
31
|
+
/** How long a change waits for its arm before it goes on as the control. */
|
|
32
|
+
const EXPOSE_TIMEOUT_MS = 1_500;
|
|
33
|
+
|
|
34
|
+
type Ask = (report: InstallExperimentReport, timeoutMs?: number) => Promise<InstallExperimentAnswer>;
|
|
35
|
+
|
|
36
|
+
/** Each experiment is asked once per session: an answer, or the control when there was none. */
|
|
37
|
+
const answers = new Map<string, Promise<string | null>>();
|
|
38
|
+
/** The experiments whose arm this session confirmed it showed. */
|
|
39
|
+
const confirmed = new Set<string>();
|
|
40
|
+
|
|
41
|
+
const askApi: Ask = (body, timeoutMs) => apiClient.reportInstallExperiment(body, timeoutMs);
|
|
42
|
+
|
|
43
|
+
/** Do Not Track, Global Privacy Control and automated browsers; the Usage setting is the install's (usageInstall). */
|
|
44
|
+
function installExperimentsAllowed(): boolean {
|
|
45
|
+
try {
|
|
46
|
+
if (browserDoNotTrack()) return false;
|
|
47
|
+
return typeof navigator === "undefined" || navigator.webdriver !== true;
|
|
48
|
+
} catch {
|
|
49
|
+
// Intentional ignore: an unreadable privacy signal sends nothing.
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function report(install: UsageInstall, experiment: string): Pick<InstallExperimentReport, "installId" | "surface" | "appVersion" | "os" | "experiment"> {
|
|
55
|
+
return {
|
|
56
|
+
installId: install.installId,
|
|
57
|
+
surface: install.surface,
|
|
58
|
+
appVersion: VERSION,
|
|
59
|
+
...(install.os ? { os: install.os } : {}),
|
|
60
|
+
experiment,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The arm of an install experiment to show, asked for when its change would
|
|
66
|
+
* show; nothing is counted until the caller confirms it. Null shows the
|
|
67
|
+
* control and is never confirmed: no answer in time, or one outside `arms`.
|
|
68
|
+
*/
|
|
69
|
+
function assignInstallExperiment<Arm extends string>(
|
|
70
|
+
experiment: string,
|
|
71
|
+
arms: readonly Arm[],
|
|
72
|
+
ask: Ask = askApi,
|
|
73
|
+
): Promise<Arm | null> {
|
|
74
|
+
const asked = answers.get(experiment);
|
|
75
|
+
if (asked) return asked as Promise<Arm | null>;
|
|
76
|
+
const answer = (async (): Promise<Arm | null> => {
|
|
77
|
+
if (!installExperimentsAllowed()) return null;
|
|
78
|
+
const install = await usageInstall();
|
|
79
|
+
if (!install) return null;
|
|
80
|
+
try {
|
|
81
|
+
const reply = await ask({ ...report(install, experiment), event: "experiment_assign" }, EXPOSE_TIMEOUT_MS);
|
|
82
|
+
const variant = reply.accepted ? reply.variant : undefined;
|
|
83
|
+
return arms.find((arm) => arm === variant) ?? null;
|
|
84
|
+
} catch (error) {
|
|
85
|
+
logFailure("install-experiments", "Install experiment assignment failed")(error);
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
})();
|
|
89
|
+
answers.set(experiment, answer);
|
|
90
|
+
return answer;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Counts the install in the arm it went on with: the exposure. Once a
|
|
95
|
+
* session, and only for an arm the API gave this session. Never throws.
|
|
96
|
+
*/
|
|
97
|
+
function confirmInstallExperiment(experiment: string, arm: string, ask: Ask = askApi): void {
|
|
98
|
+
if (confirmed.has(experiment)) return;
|
|
99
|
+
confirmed.add(experiment);
|
|
100
|
+
void (async () => {
|
|
101
|
+
if (await answers.get(experiment) !== arm) return;
|
|
102
|
+
const install = await usageInstall();
|
|
103
|
+
if (!install) return;
|
|
104
|
+
await ask({ ...report(install, experiment), event: "experiment_exposed", variant: arm });
|
|
105
|
+
})().catch(logFailure("install-experiments", "Install experiment exposure failed"));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* first_run_tickers' arm for this install, asked once the step would show.
|
|
110
|
+
* Null is the control without an answer, which is never counted.
|
|
111
|
+
*/
|
|
112
|
+
export function assignFirstRunTickers(ask?: Ask): Promise<FirstRunTickersArm | null> {
|
|
113
|
+
return assignInstallExperiment(FIRST_RUN_TICKERS_EXPERIMENT, FIRST_RUN_TICKERS_ARMS, ask);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** The first run went on with `arm` (the step shown, or today's first run): count the exposure. */
|
|
117
|
+
export function confirmFirstRunTickers(arm: FirstRunTickersArm, ask?: Ask): void {
|
|
118
|
+
confirmInstallExperiment(FIRST_RUN_TICKERS_EXPERIMENT, arm, ask);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* "Which tickers do you follow?" closed: how many names it put on the
|
|
123
|
+
* watchlist (0-3) and whether Skip closed it, never which. Never throws.
|
|
124
|
+
*/
|
|
125
|
+
export function recordFirstRunTickersFinished(
|
|
126
|
+
{ picked, skipped }: { picked: number; skipped: boolean },
|
|
127
|
+
ask: Ask = askApi,
|
|
128
|
+
): void {
|
|
129
|
+
void (async () => {
|
|
130
|
+
if (!installExperimentsAllowed()) return;
|
|
131
|
+
const install = await usageInstall();
|
|
132
|
+
if (!install) return;
|
|
133
|
+
await ask({
|
|
134
|
+
...report(install, FIRST_RUN_TICKERS_EXPERIMENT),
|
|
135
|
+
event: "onboarding_tickers_finished",
|
|
136
|
+
picked: skipped ? 0 : Math.max(0, Math.min(3, Math.round(picked))),
|
|
137
|
+
skipped,
|
|
138
|
+
});
|
|
139
|
+
})().catch(logFailure("install-experiments", "Recording the first-run tickers step failed"));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Test seam: forgets the arms asked for in this session. */
|
|
143
|
+
export function resetInstallExperimentsForTests(): void {
|
|
144
|
+
answers.clear();
|
|
145
|
+
confirmed.clear();
|
|
146
|
+
}
|
|
@@ -37,6 +37,13 @@ export interface MoneyMarketRow {
|
|
|
37
37
|
fetchedAt: string | null;
|
|
38
38
|
unavailableReason: "source-unavailable" | "metadata-unavailable" | "metadata-mismatch" | "no-observations" | "components-unavailable" | null;
|
|
39
39
|
notes: string[];
|
|
40
|
+
/** A bill's coupon equivalent (investment rate), percent, beside its discount-basis `value`; on bill rows only. */
|
|
41
|
+
couponEquivalent?: number | null;
|
|
42
|
+
couponEquivalentAsOf?: string | null;
|
|
43
|
+
/** Who published the row's latest value (`U.S. Treasury`, `FRED`); older servers send none. */
|
|
44
|
+
sourceName?: string;
|
|
45
|
+
/** When the publisher last changed what was read, when it says. */
|
|
46
|
+
publishedAt?: string | null;
|
|
40
47
|
}
|
|
41
48
|
|
|
42
49
|
interface BillSnapshot {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { logFailure } from "../utils/log-failure";
|
|
2
|
+
import { debugLog } from "../utils/debug-log";
|
|
2
3
|
import { httpFetch, isHttpFetchStreaming } from "../utils/http-transport";
|
|
3
4
|
import { OperationTimeoutError } from "../utils/async-deadline";
|
|
4
5
|
import {
|
|
@@ -18,6 +19,9 @@ import {
|
|
|
18
19
|
import { SESSION_COOKIE_NAMES } from "./session-cookie";
|
|
19
20
|
import { asDataServiceFailure, DataServiceUnreachableError, isDroppedConnection } from "../utils/network-failure";
|
|
20
21
|
|
|
22
|
+
/** Request failures with the endpoint they were for, which their messages leave out. */
|
|
23
|
+
const requestLog = debugLog.createLogger("cloud-api");
|
|
24
|
+
|
|
21
25
|
/** The public Gloom Cloud API, which the web app's same-origin `/api` path forwards to. */
|
|
22
26
|
export const DEFAULT_API_URL = "https://api.gloom.sh";
|
|
23
27
|
/**
|
|
@@ -577,11 +581,17 @@ export class CloudApiRequestTransport {
|
|
|
577
581
|
const answered = () => this.answers > answersAtStart;
|
|
578
582
|
const generation = cloudApiTransportGeneration;
|
|
579
583
|
const what = path.startsWith("/market/") ? "Cloud market request" : "Cloud request";
|
|
580
|
-
|
|
584
|
+
// The endpoint stays out of the message, which reports and panes print; the debug log's line names it.
|
|
585
|
+
const endpoint = path.split("?")[0]!;
|
|
586
|
+
const failed = (message: string) => {
|
|
587
|
+
requestLog.warn(message, { endpoint });
|
|
588
|
+
return new OperationTimeoutError(message);
|
|
589
|
+
};
|
|
590
|
+
const timedOut = (ms: number) => failed(`${what} timed out after ${ms}ms`);
|
|
581
591
|
const timers: Array<ReturnType<typeof setTimeout>> = [];
|
|
582
592
|
if (this.hungAt != null && Date.now() - this.hungAt < HUNG_FAIL_FAST_MS && !controller.signal.aborted) {
|
|
583
593
|
callerSignal?.removeEventListener("abort", abortFromCaller);
|
|
584
|
-
throw new DataServiceUnreachableError(
|
|
594
|
+
throw new DataServiceUnreachableError(failed(`${what} not sent: the last one got no answer`));
|
|
585
595
|
}
|
|
586
596
|
this.pending += 1;
|
|
587
597
|
try {
|