@gloom-sh/terminal 0.20.17 → 0.20.19
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/cot.ts +5 -6
- package/src/api-client/data.ts +14 -3
- package/src/api-client/heard-from.ts +72 -0
- package/src/api-client/index.ts +64 -6
- package/src/api-client/mna.ts +18 -0
- package/src/api-client/request.ts +162 -40
- package/src/api-client/supply-chain.ts +9 -0
- package/src/api-client/types/billing.ts +35 -1
- package/src/api-client/types/news.ts +45 -0
- package/src/api-client/types/world-venues.ts +9 -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 +37 -4
- package/src/architecture/core-builtin-allowlist.json +1 -1
- package/src/architecture/floating-promise-allowlist.json +1 -2
- package/src/architecture/shortcut-labels-allowlist.json +1 -0
- package/src/cli/alert-listing.ts +98 -0
- package/src/cli/commands/market.ts +191 -39
- package/src/cli/commands/overview.ts +7 -1
- package/src/cli/commands/plugins.ts +3 -2
- package/src/cli/commands/search.ts +30 -6
- package/src/cli/commands/ticker.ts +13 -6
- package/src/cli/context.ts +24 -5
- package/src/cli/csv-export.ts +2 -1
- package/src/cli/desktop-pane-shot-browser.ts +3 -1
- package/src/cli/desktop-pane-shot-view.ts +0 -1
- package/src/cli/desktop-pane-shot.ts +276 -52
- package/src/cli/errors.ts +3 -9
- package/src/cli/exit-codes.ts +1 -1
- package/src/cli/glossary.ts +65 -11
- package/src/cli/help.ts +1 -1
- package/src/cli/history-demergers.ts +117 -0
- package/src/cli/history-rows.ts +8 -4
- package/src/cli/index.ts +2 -1
- package/src/cli/known-gaps.ts +16 -0
- package/src/cli/known-us-stocks.ts +18 -0
- package/src/cli/listing-arg.ts +192 -38
- package/src/cli/pane-functions/catalog-snapshot-build.ts +83 -0
- package/src/cli/pane-functions/catalog-snapshot.json +877 -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 +54 -8
- package/src/cli/pane-functions/freshness.ts +39 -4
- package/src/cli/pane-functions/function-help.ts +3 -3
- package/src/cli/pane-functions/headless.ts +9 -1
- package/src/cli/pane-functions/index.ts +175 -50
- package/src/cli/pane-functions/report-notices.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +11 -7
- package/src/cli/pane-functions/screenshot-assessment.ts +38 -10
- package/src/cli/pane-functions/screenshot-data-evidence.ts +7 -15
- package/src/cli/pane-functions/screenshot-payload.ts +36 -1
- package/src/cli/pane-functions/screenshot-render.ts +24 -9
- package/src/cli/pane-functions/screenshot-types.ts +9 -0
- package/src/cli/quote-answer.ts +33 -17
- package/src/cli/registry.ts +22 -2
- package/src/cli/result.ts +22 -4
- package/src/cli/scroll-truncation.ts +7 -2
- package/src/cli/series-search.ts +45 -6
- package/src/cli/shot-temp-dir.ts +4 -9
- package/src/cli/ticker-resolution.ts +1 -1
- package/src/cli/unreachable.ts +21 -0
- package/src/components/chart/composite/drawing-store.ts +11 -7
- package/src/components/chart/composite/format.ts +1 -0
- package/src/components/chart/composite/legend.tsx +48 -20
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +3 -3
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +9 -2
- package/src/components/chart/composite/panel-surface.tsx +1 -1
- package/src/components/chart/composite/price-axis-labels.tsx +7 -5
- package/src/components/chart/composite/tools.ts +164 -39
- package/src/components/chart-table/header.tsx +11 -2
- package/src/components/chart-table/layout.ts +16 -17
- 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 +19 -4
- package/src/components/command-bar/routes/ticker-search/results.ts +5 -0
- package/src/components/command-bar/routes/ticker-search/route.ts +5 -0
- package/src/components/command-bar/selection-runtime.ts +29 -5
- package/src/components/command-bar/surface/index.tsx +4 -1
- package/src/components/command-bar/workflow/alert.ts +32 -13
- 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 +123 -17
- package/src/components/layout/pane/header.tsx +16 -2
- package/src/components/layout/pane/status-footer.ts +24 -0
- 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/price-performance.tsx +26 -8
- package/src/components/reader/article-reader.tsx +12 -5
- 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/opentui/index.tsx +7 -0
- package/src/components/ui/data-table/types.ts +8 -0
- 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 +34 -2
- 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 +122 -0
- package/src/market-data/coordinator/entries.ts +6 -4
- package/src/market-data/coordinator/index.ts +14 -3
- package/src/market-data/depositary-pair.ts +6 -2
- package/src/market-data/futures-board.ts +36 -29
- package/src/market-data/futures-contract.ts +37 -1
- package/src/market-data/hooks.tsx +33 -2
- package/src/market-data/market/change-basis.ts +11 -1
- package/src/market-data/market/header-market.ts +11 -0
- package/src/market-data/market/status.ts +40 -4
- package/src/market-data/performance.ts +127 -32
- package/src/market-data/quotes/time.ts +5 -2
- package/src/market-data/split-terms.ts +28 -0
- package/src/news/types.ts +28 -0
- package/src/notifications/app-badge.ts +2 -3
- package/src/notifications/app-notifier.ts +5 -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 +101 -48
- package/src/plugins/builtin/alerts/command.ts +39 -9
- package/src/plugins/builtin/alerts/constants.ts +10 -0
- package/src/plugins/builtin/alerts/earnings-listing.ts +20 -0
- package/src/plugins/builtin/alerts/event-rows.ts +9 -3
- package/src/plugins/builtin/alerts/events-pane.tsx +16 -10
- package/src/plugins/builtin/alerts/format.ts +24 -8
- package/src/plugins/builtin/alerts/headless.ts +12 -6
- package/src/plugins/builtin/alerts/index.tsx +97 -16
- package/src/plugins/builtin/alerts/move-checks.ts +7 -0
- package/src/plugins/builtin/alerts/option-contract.ts +197 -0
- package/src/plugins/builtin/alerts/pane.tsx +1 -1
- package/src/plugins/builtin/alerts/price.ts +30 -5
- package/src/plugins/builtin/alerts/pro-rules.ts +62 -0
- package/src/plugins/builtin/alerts/quotes.ts +26 -2
- package/src/plugins/builtin/alerts/research-builder.ts +5 -10
- package/src/plugins/builtin/alerts/scheduled.ts +6 -1
- package/src/plugins/builtin/alerts/types.ts +7 -0
- package/src/plugins/builtin/analytics/account-returns.ts +1 -1
- package/src/plugins/builtin/analytics/manual-value.ts +61 -0
- package/src/plugins/builtin/analytics/pane-model.ts +2 -2
- package/src/plugins/builtin/analytics/risk-book.ts +7 -7
- package/src/plugins/builtin/analytics/risk-client.ts +27 -14
- 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 +1 -1
- package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -14
- package/src/plugins/builtin/catalysts/model.ts +2 -1
- 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/chart-spec.ts +5 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +9 -5
- package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +2 -6
- package/src/plugins/builtin/chart-composer/headless-schema.ts +14 -10
- package/src/plugins/builtin/chart-composer/headless.ts +2 -0
- package/src/plugins/builtin/chart-composer/index.tsx +17 -5
- package/src/plugins/builtin/chart-composer/pane.tsx +19 -6
- package/src/plugins/builtin/chart-composer/viewport-labels.ts +2 -17
- package/src/plugins/builtin/chat/controller/notifications.ts +1 -0
- package/src/plugins/builtin/chat/index.tsx +0 -1
- 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/commodities-energy/index.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +10 -5
- package/src/plugins/builtin/company-kpis/latest.ts +45 -0
- package/src/plugins/builtin/company-kpis/model.ts +57 -15
- 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/congress-trades/model.ts +9 -5
- package/src/plugins/builtin/correlation/index.tsx +13 -17
- package/src/plugins/builtin/correlation/matrix/model.ts +18 -0
- package/src/plugins/builtin/cot/client.ts +2 -3
- package/src/plugins/builtin/cot/headless.ts +16 -16
- package/src/plugins/builtin/cot/index.tsx +6 -6
- package/src/plugins/builtin/cot/model.ts +25 -5
- package/src/plugins/builtin/cot/pane.tsx +11 -6
- package/src/plugins/builtin/cot/series.ts +11 -8
- package/src/plugins/builtin/cpi/model.ts +15 -4
- package/src/plugins/builtin/cpi/pane.tsx +29 -7
- 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/doe/model.ts +30 -0
- package/src/plugins/builtin/doe/pane.tsx +8 -2
- package/src/plugins/builtin/earnings/board-table.ts +9 -4
- package/src/plugins/builtin/earnings/fiscal-quarter.ts +39 -0
- package/src/plugins/builtin/earnings/headless.ts +16 -6
- package/src/plugins/builtin/earnings/history-model.ts +6 -4
- package/src/plugins/builtin/earnings/history-table.ts +7 -4
- package/src/plugins/builtin/earnings-calls/calendar.tsx +4 -3
- package/src/plugins/builtin/earnings-calls/pane.tsx +8 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +2 -2
- package/src/plugins/builtin/econ/calendar-model.ts +16 -0
- package/src/plugins/builtin/econ/index.tsx +7 -2
- 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/futures/model.ts +14 -1
- package/src/plugins/builtin/futures/series.ts +1 -8
- 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 +25 -7
- package/src/plugins/builtin/fx-matrix/settings.ts +9 -4
- package/src/plugins/builtin/insider/detail.tsx +36 -7
- package/src/plugins/builtin/insider/filing-stories.ts +110 -0
- package/src/plugins/builtin/insider/headless.ts +37 -2
- package/src/plugins/builtin/insider/index.tsx +79 -10
- package/src/plugins/builtin/insider/model.ts +43 -5
- package/src/plugins/builtin/ipo-calendar/client.ts +11 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +3 -7
- package/src/plugins/builtin/jobs/headless.ts +2 -1
- package/src/plugins/builtin/jobs/model.ts +6 -0
- package/src/plugins/builtin/jobs/pane.tsx +8 -3
- 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/detail-view.tsx +118 -10
- package/src/plugins/builtin/news/wire/news/footer.ts +3 -8
- package/src/plugins/builtin/news/wire/news/story-evidence.ts +178 -0
- package/src/plugins/builtin/options/analytics.ts +1 -1
- package/src/plugins/builtin/options/view.tsx +18 -11
- package/src/plugins/builtin/options-positioning/model.ts +11 -0
- package/src/plugins/builtin/options-positioning/pane.tsx +22 -1
- package/src/plugins/builtin/options-scenario/client.ts +49 -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/headless.ts +7 -3
- package/src/plugins/builtin/options-scenario/model.ts +33 -2
- package/src/plugins/builtin/options-scenario/pane.tsx +3 -4
- 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/perps/cascade.ts +4 -3
- package/src/plugins/builtin/perps/markets-section.tsx +5 -2
- package/src/plugins/builtin/perps/model.ts +4 -3
- 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/portfolio-list/table.tsx +3 -2
- package/src/plugins/builtin/relative-rotation/pane.tsx +2 -3
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +33 -14
- package/src/plugins/builtin/research/event-model.ts +43 -19
- package/src/plugins/builtin/research/headless.ts +8 -1
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +19 -17
- package/src/plugins/builtin/research-search/index.tsx +3 -1
- package/src/plugins/builtin/scanner/denied.tsx +16 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
- package/src/plugins/builtin/sec/filing-display.tsx +14 -2
- package/src/plugins/builtin/sec/headless.ts +42 -4
- package/src/plugins/builtin/sec/index.tsx +21 -1
- package/src/plugins/builtin/sectors/index.tsx +6 -9
- package/src/plugins/builtin/sectors/sector-model.ts +1 -1
- package/src/plugins/builtin/shared/cloud-upgrade.ts +1 -1
- package/src/plugins/builtin/shared/earnings-report.ts +49 -5
- package/src/plugins/builtin/shared/options-pro-copy.ts +34 -0
- package/src/plugins/builtin/shared/report-freshness.ts +2 -3
- package/src/plugins/builtin/shared/statement-currency.ts +23 -0
- package/src/plugins/builtin/shared/ticker-surface.ts +1 -1
- 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 +79 -18
- package/src/plugins/builtin/themes/headless.ts +4 -4
- package/src/plugins/builtin/themes/model.ts +11 -8
- package/src/plugins/builtin/themes/pane.tsx +2 -2
- 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 +51 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +25 -14
- package/src/plugins/builtin/ticker-detail/financials/model.ts +22 -32
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +7 -9
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +2 -0
- package/src/plugins/builtin/ticker-detail/headless.ts +28 -12
- package/src/plugins/builtin/ticker-detail/overview/board-lot.ts +21 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -2
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +8 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +68 -13
- 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/volatility/model.ts +17 -0
- package/src/plugins/builtin/volatility/pane.tsx +16 -7
- 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 +32 -18
- 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/model.ts +6 -1
- 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/builtin/world-venue-map/venue-header.tsx +5 -3
- package/src/plugins/catalog-browser.ts +10 -1
- 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/browser/activity.ts +16 -0
- package/src/renderers/browser/app-badge-host.ts +14 -0
- package/src/renderers/browser/main.tsx +5 -0
- package/src/renderers/browser/notifications.ts +103 -0
- package/src/renderers/browser/ui-host.tsx +4 -0
- package/src/renderers/desktop/window-layouts.ts +14 -0
- package/src/renderers/dom/data-table/index.tsx +27 -4
- 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-frame.tsx +50 -12
- package/src/renderers/electrobun/view/http-fetch.ts +3 -2
- 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/index.ts +22 -9
- package/src/sources/gloomberb-cloud/news.ts +35 -0
- package/src/sources/gloomberb-cloud/perpetuals.ts +60 -3
- package/src/sources/provider-errors.ts +34 -7
- package/src/sources/provider-router/financials.ts +20 -13
- package/src/sources/provider-router/history.ts +32 -6
- 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 +39 -6
- package/src/time-series/chart-seed.ts +2 -2
- package/src/time-series/history-quality.ts +4 -1
- package/src/time-series/hooks.ts +2 -0
- package/src/time-series/price-comparison.ts +17 -23
- package/src/time-series/reporting.ts +1 -1
- package/src/time-series/resolution.ts +13 -0
- package/src/time-series/resolve-context.ts +6 -0
- package/src/time-series/resolve.ts +42 -3
- package/src/time-series/spec.ts +2 -2
- package/src/time-series/types.ts +3 -2
- package/src/types/data-provider.ts +11 -0
- package/src/types/financials.ts +48 -4
- package/src/types/headless.ts +1 -0
- package/src/types/issuer-listings.ts +2 -0
- package/src/types/plugin-notifications.ts +3 -0
- package/src/types/price-history.ts +6 -4
- package/src/types/ticker.ts +10 -2
- package/src/ui/host.tsx +2 -0
- 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/exchange-announcements.ts +7 -2
- package/src/utils/forward-dividend.ts +4 -3
- package/src/utils/fundamentals.ts +40 -0
- package/src/utils/network-failure.ts +2 -0
- package/src/utils/price-history-integrity.ts +9 -1
- package/src/utils/remove-folder.ts +37 -0
- package/src/utils/trailing-dividend.ts +1 -1
- package/src/plugins/builtin/composite-plugins.ts +0 -285
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
1
|
+
import { Fragment, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { apiClient } from "../../api-client";
|
|
3
3
|
import type { SignedInBroker } from "../../brokers/signed-in/client";
|
|
4
4
|
import { runBrokerSignIn, type BrokerSignInOutcome } from "../../brokers/signed-in/sign-in";
|
|
@@ -274,8 +274,10 @@ export function FormModalContent({
|
|
|
274
274
|
|
|
275
275
|
// Effects that follow what is typed run here, with the values, and each
|
|
276
276
|
// acts only in the form it belongs to, going by its workflow id.
|
|
277
|
+
const { dataProvider, tickerRepository } = runtime.getDeps();
|
|
278
|
+
const alertListingDeps = useMemo(() => ({ dataProvider, store: tickerRepository }), [dataProvider, tickerRepository]);
|
|
277
279
|
useAlertWorkflowQuoteSync({
|
|
278
|
-
|
|
280
|
+
listingDeps: alertListingDeps,
|
|
279
281
|
route,
|
|
280
282
|
updateRoute,
|
|
281
283
|
});
|
|
@@ -433,8 +435,11 @@ export function FormModalContent({
|
|
|
433
435
|
),
|
|
434
436
|
});
|
|
435
437
|
}
|
|
436
|
-
if (
|
|
437
|
-
|
|
438
|
+
if (!mountedRef.current) return;
|
|
439
|
+
if (applied) moveOn(field.id);
|
|
440
|
+
// The picker held the keyboard: give it back to the form's field, or keys go to the panes under the form.
|
|
441
|
+
requestInputFocus();
|
|
442
|
+
}, [desktop, dialog, moveOn, requestInputFocus, setValue]);
|
|
438
443
|
|
|
439
444
|
const modalWidth = Math.min(width, Math.max(1, viewport.width - 2));
|
|
440
445
|
const contentWidth = Math.max(10, modalWidth - TERMINAL_DIALOG_INSET);
|
package/src/components/index.ts
CHANGED
|
@@ -138,7 +138,7 @@ export {
|
|
|
138
138
|
DetailScrollBody, DialogFrame, DisclosureMarker, Divider, EmptyState, ExternalLink, ExternalLinkText, FieldGrid, FieldLabel,
|
|
139
139
|
fieldFrameStyle, fieldGridColumns, FRAMED_TEXTAREA_DESKTOP_STYLE, fieldGridRows, FigureList, getMessageComposerBlockHeight, GridFieldView, Icon, ICON_GLYPHS,
|
|
140
140
|
IconButton, InlineQuickAddRow, KeyValueRow, ListView, loadingText, Menu, MenuPopover,
|
|
141
|
-
MessageComposer, MultiSelectDialogButton, MultiSelectDialogContent, Notice, NumberField,
|
|
141
|
+
MessageComposer, MultiSelectDialogButton, MultiSelectDialogContent, Notice, NumberField, RowNote,
|
|
142
142
|
NumberPromptDialog, openUrl, PageStackView, PaneLinkMenu, PaneStatusBody, Popover, Prose,
|
|
143
143
|
QueryBar, RangeTrack, RatioBar, READING_WIDTH, RemoteImage, Section, SectionHeading, SegmentedControl, SelectButton, ShortcutHint,
|
|
144
144
|
Spinner, StatGrid, statGridColumns, statGridRows, Tabs, TextField, TextPromptDialog, unavailableText,
|
|
@@ -865,8 +865,10 @@ function HeaderHelpButton({ nativePaneChrome, onPress }: { nativePaneChrome: boo
|
|
|
865
865
|
export function Header({
|
|
866
866
|
onOpenHelp,
|
|
867
867
|
onRestartForUpdate,
|
|
868
|
+
commandInputAvailable = true,
|
|
868
869
|
}: {
|
|
869
870
|
onOpenHelp?: () => void;
|
|
871
|
+
commandInputAvailable?: boolean;
|
|
870
872
|
/** Applies a downloaded desktop update and relaunches; the header offers Restart only when it is given. */
|
|
871
873
|
onRestartForUpdate?: () => void;
|
|
872
874
|
}) {
|
|
@@ -893,7 +895,7 @@ export function Header({
|
|
|
893
895
|
let updateStatusColumns = Math.max(
|
|
894
896
|
0,
|
|
895
897
|
prompt.updateColumns
|
|
896
|
-
- (onOpenHelp ? terminalButtonColumns(helpButtonProps()) + TERMINAL_HELP_PADDING_COLUMNS : 0)
|
|
898
|
+
- (commandInputAvailable && onOpenHelp ? terminalButtonColumns(helpButtonProps()) + TERMINAL_HELP_PADDING_COLUMNS : 0)
|
|
897
899
|
- UPDATE_SLOT_PADDING_COLUMNS * (titleBarOverlay ? 2 : 1),
|
|
898
900
|
);
|
|
899
901
|
// Short of that, the closed prompt gives the status its empty room, down to
|
|
@@ -928,7 +930,9 @@ export function Header({
|
|
|
928
930
|
dispatch({ type: "SET_COMMAND_BAR", open: true, query: "" });
|
|
929
931
|
}, [dispatch]);
|
|
930
932
|
|
|
931
|
-
|
|
933
|
+
// An open bar always has its input, whatever opened it: without one, what
|
|
934
|
+
// the user types or pastes goes nowhere and Enter runs the first suggestion.
|
|
935
|
+
const commandPrompt = commandInputAvailable || commandBarOpen ? (
|
|
932
936
|
<HeaderCommandPrompt
|
|
933
937
|
nativePaneChrome={nativePaneChrome}
|
|
934
938
|
onOpen={openCommandBar}
|
|
@@ -936,7 +940,7 @@ export function Header({
|
|
|
936
940
|
shortcutLabel={shortcutLabel}
|
|
937
941
|
width={promptWidth}
|
|
938
942
|
/>
|
|
939
|
-
)
|
|
943
|
+
) : <Box width={promptWidth} />;
|
|
940
944
|
const marketSummary = prompt.marketColumns > 0
|
|
941
945
|
? <HeaderMarketSummary nativePaneChrome={nativePaneChrome} width={prompt.marketColumns} />
|
|
942
946
|
: null;
|
|
@@ -982,7 +986,7 @@ export function Header({
|
|
|
982
986
|
<UpdateStatus columns={updateStatusColumns} onRestart={onRestartForUpdate} status={updateStatus} />
|
|
983
987
|
</Box>
|
|
984
988
|
)}
|
|
985
|
-
{onOpenHelp ? <HeaderHelpButton nativePaneChrome onPress={onOpenHelp} /> : null}
|
|
989
|
+
{commandInputAvailable && onOpenHelp ? <HeaderHelpButton nativePaneChrome onPress={onOpenHelp} /> : null}
|
|
986
990
|
{marketSummary}
|
|
987
991
|
{showWindowControls ? <Box flexShrink={0} width={`${WINDOWS_CONTROL_GROUP_WIDTH_PX}px`} /> : null}
|
|
988
992
|
{showWindowControls ? <WindowControls /> : null}
|
|
@@ -1006,7 +1010,7 @@ export function Header({
|
|
|
1006
1010
|
<UpdateStatus columns={updateStatusColumns} onRestart={onRestartForUpdate} status={updateStatus} />
|
|
1007
1011
|
</Box>
|
|
1008
1012
|
)}
|
|
1009
|
-
{onOpenHelp ? <HeaderHelpButton nativePaneChrome={nativePaneChrome} onPress={onOpenHelp} /> : null}
|
|
1013
|
+
{commandInputAvailable && onOpenHelp ? <HeaderHelpButton nativePaneChrome={nativePaneChrome} onPress={onOpenHelp} /> : null}
|
|
1010
1014
|
{marketSummary}
|
|
1011
1015
|
{showWindowControls ? <WindowControls /> : null}
|
|
1012
1016
|
</Box>
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { createContext, useContext } from "react";
|
|
2
2
|
|
|
3
|
+
export const PaneCaptureContext = createContext(false);
|
|
4
|
+
|
|
5
|
+
export function usePaneCapture(): boolean {
|
|
6
|
+
return useContext(PaneCaptureContext);
|
|
7
|
+
}
|
|
8
|
+
|
|
3
9
|
/**
|
|
4
10
|
* True inside a `gloom shot` whose status line dates the pane's data: the
|
|
5
11
|
* pane's own `as of` text (a query bar's `asOf`) is left out, so the date is
|
|
@@ -166,6 +166,8 @@ function SegmentView({ segment, focused }: { segment: PaneFooterSegment; focused
|
|
|
166
166
|
onMouseDown={interactive ? startSegmentPress : undefined}
|
|
167
167
|
onMouseUp={interactive ? finishSegmentPress : undefined}
|
|
168
168
|
{...(interactive ? { "data-gloom-interactive": "true" } : {})}
|
|
169
|
+
// A capture reads the pane's state from its body: the notes about its data are not that state.
|
|
170
|
+
{...(!segment.icon && segment.notes?.length ? { "data-gloom-role": "pane-footer-notes" } : {})}
|
|
169
171
|
>
|
|
170
172
|
{[
|
|
171
173
|
...segment.parts.map((part, index) => (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ContextMenuItem } from "../../../../types/context-menu";
|
|
2
2
|
import { t, tf } from "../../../../i18n";
|
|
3
3
|
import { type CompanyFrom, companyFromLabel } from "../../../../types/company-from";
|
|
4
|
-
import {
|
|
4
|
+
import { displayWidth } from "../../../../utils/format";
|
|
5
5
|
import { formatShortDate } from "../../../../utils/datetime-format";
|
|
6
6
|
import { readableStatus } from "../../../../utils/reason-codes";
|
|
7
7
|
import { getShortcutHintWidth } from "../../../ui/shortcut-hint";
|
|
@@ -53,6 +53,21 @@ export interface PaneFooterSegment {
|
|
|
53
53
|
* warning.
|
|
54
54
|
*/
|
|
55
55
|
capture?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The pane's figures cannot be read without the segment: the session OMON's
|
|
58
|
+
* open interest counts are from. A row too narrow shortens it to its last
|
|
59
|
+
* variant and leaves out the segments around it first, as it does beside a
|
|
60
|
+
* warning, so it never goes while those figures show.
|
|
61
|
+
*/
|
|
62
|
+
holdsPlace?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The notes behind a warning icon (usePaneNoticeFooter), each in full. The
|
|
65
|
+
* icon opens them in the app. A picture of the pane cannot, so it draws a
|
|
66
|
+
* segment carrying `notes` and no icon as its one note line
|
|
67
|
+
* ({@link noteLineParts}): the first note, cut after a whole word when the
|
|
68
|
+
* row is short, and how many more there are.
|
|
69
|
+
*/
|
|
70
|
+
notes?: readonly string[];
|
|
56
71
|
/**
|
|
57
72
|
* The segment only says how long ago the pane's data loaded (`5m ago`,
|
|
58
73
|
* `fetched just now`), relative to the moment it is read: build it with
|
|
@@ -349,14 +364,16 @@ export function paneFooterInfoWidth(segments: readonly PaneFooterSegment[]): num
|
|
|
349
364
|
return infoTextWidth(segments);
|
|
350
365
|
}
|
|
351
366
|
|
|
367
|
+
/** Cells a segment's parts take, a column between two as the footer draws them. */
|
|
368
|
+
function partsWidth(parts: readonly PaneFooterPart[]): number {
|
|
369
|
+
return parts.reduce((sum, part, partIndex) => sum + (partIndex > 0 ? 1 : 0) + displayWidth(part.text), 0);
|
|
370
|
+
}
|
|
371
|
+
|
|
352
372
|
function infoTextWidth(segments: readonly PaneFooterSegment[]): number {
|
|
353
373
|
if (segments.length === 0) return 0;
|
|
354
|
-
return segments.reduce((total, segment, index) =>
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
), 0);
|
|
358
|
-
return total + (index > 0 ? segmentGapWidth(segments[index - 1]!, segment) : 0) + text;
|
|
359
|
-
}, 0);
|
|
374
|
+
return segments.reduce((total, segment, index) => (
|
|
375
|
+
total + (index > 0 ? segmentGapWidth(segments[index - 1]!, segment) : 0) + partsWidth(segment.parts)
|
|
376
|
+
), 0);
|
|
360
377
|
}
|
|
361
378
|
|
|
362
379
|
/** Segments with `variants` step down together, one variant at a time, until they fit or none is left. */
|
|
@@ -376,9 +393,9 @@ function stepDownTogether(info: PaneFooterSegment[], width: number): PaneFooterS
|
|
|
376
393
|
return fitted;
|
|
377
394
|
}
|
|
378
395
|
|
|
379
|
-
/** A warning, an icon
|
|
396
|
+
/** A warning, an icon, a pressable segment or one marked `holdsPlace`, which a row too narrow never cuts or leaves out. */
|
|
380
397
|
function holdsItsPlace(segment: PaneFooterSegment): boolean {
|
|
381
|
-
return !!segment.icon || !!segment.onPress || segment.parts.some((part) => part.tone === "warning" || part.tone === "negative");
|
|
398
|
+
return !!segment.icon || !!segment.onPress || !!segment.holdsPlace || segment.parts.some((part) => part.tone === "warning" || part.tone === "negative");
|
|
382
399
|
}
|
|
383
400
|
|
|
384
401
|
/**
|
|
@@ -401,12 +418,77 @@ function trimTrailing(info: PaneFooterSegment[], width: number, keep: number, pa
|
|
|
401
418
|
const segment = fitted[index]!;
|
|
402
419
|
const own = infoTextWidth([segment]);
|
|
403
420
|
const room = width - (infoTextWidth(fitted) - own) - (index === fitted.length - 1 ? 1 : 0);
|
|
404
|
-
|
|
421
|
+
const clipped = room * 2 >= own ? clipSegment(segment, room) : null;
|
|
422
|
+
if (clipped) return [...fitted.slice(0, index), clipped, ...fitted.slice(index + 1)];
|
|
405
423
|
fitted = [...fitted.slice(0, index), ...fitted.slice(index + 1)];
|
|
406
424
|
}
|
|
407
425
|
return fitted;
|
|
408
426
|
}
|
|
409
427
|
|
|
428
|
+
/** A note line: a pane's notes said in words where nothing can open them (a pane picture), not behind its icon. */
|
|
429
|
+
function isNoteLine(segment: PaneFooterSegment): boolean {
|
|
430
|
+
return !segment.icon && !!segment.notes?.length;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* The most of a row a note line takes from the status beside it: the rest is
|
|
435
|
+
* the status's, so a capture's status line still says what its data is as of.
|
|
436
|
+
*/
|
|
437
|
+
const NOTE_LINE_SHARE = 0.6;
|
|
438
|
+
|
|
439
|
+
/** Punctuation a cut note does not end on before its ellipsis: "unreconciled,…" reads "unreconciled…", "depth 1.…" "depth 1…". */
|
|
440
|
+
const TRAILING_PUNCTUATION = /[\s,.;:·\-–—(]+$/u;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* `text` cut after its last whole word that fits `width` with an ellipsis,
|
|
444
|
+
* never inside a word; empty when not even its first word fits.
|
|
445
|
+
*/
|
|
446
|
+
export function cutAtWord(text: string, width: number): string {
|
|
447
|
+
if (displayWidth(text) <= width) return text;
|
|
448
|
+
const ellipsis = "…";
|
|
449
|
+
let best = "";
|
|
450
|
+
for (const match of text.matchAll(/\s+/g)) {
|
|
451
|
+
const head = text.slice(0, match.index).replace(TRAILING_PUNCTUATION, "");
|
|
452
|
+
if (!head) continue;
|
|
453
|
+
if (displayWidth(head) + displayWidth(ellipsis) > width) break;
|
|
454
|
+
best = head;
|
|
455
|
+
}
|
|
456
|
+
return best ? `${best}${ellipsis}` : "";
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* A pane's notes as one line `width` cells wide: the first note whole, or cut
|
|
461
|
+
* after a whole word with an ellipsis, then how many more there are (`+3
|
|
462
|
+
* more`), which the app opens from the footer's ⚠ (`!`). Where not even a
|
|
463
|
+
* word of it fits, the count of notes alone.
|
|
464
|
+
*/
|
|
465
|
+
export function noteLineParts(notes: readonly string[], width: number): PaneFooterPart[] {
|
|
466
|
+
const [first = "", ...rest] = notes;
|
|
467
|
+
const more = rest.length ? tf("+{count} more", { count: rest.length }) : "";
|
|
468
|
+
const tail: PaneFooterPart[] = more ? [{ text: more, tone: "label" }] : [];
|
|
469
|
+
const room = width - (more ? displayWidth(more) + 1 : 0);
|
|
470
|
+
const shown = cutAtWord(first, room);
|
|
471
|
+
if (shown) return [{ text: shown, tone: "warning" }, ...tail];
|
|
472
|
+
return [{ text: notes.length === 1 ? t("1 note") : tf("{count} notes", { count: notes.length }), tone: "warning" }];
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Each note line in `info` at the room `width` leaves it: what the status
|
|
477
|
+
* beside it does not take, and at least NOTE_LINE_SHARE of the row while its
|
|
478
|
+
* first note needs that much, so a long status line gives way to its shorter
|
|
479
|
+
* forms before the note is cut.
|
|
480
|
+
*/
|
|
481
|
+
function fitNoteLines(info: PaneFooterSegment[], width: number): PaneFooterSegment[] {
|
|
482
|
+
if (!info.some(isNoteLine)) return info;
|
|
483
|
+
return info.map((segment, index) => {
|
|
484
|
+
if (!isNoteLine(segment)) return segment;
|
|
485
|
+
const notes = segment.notes!;
|
|
486
|
+
const others = infoTextWidth(info.map((other, at) => (at === index ? { ...other, parts: [] } : other)));
|
|
487
|
+
const room = Math.max(width - others, Math.floor(width * NOTE_LINE_SHARE));
|
|
488
|
+
return { ...segment, title: segment.title ?? notes.join("\n"), parts: noteLineParts(notes, room) };
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
|
|
410
492
|
/**
|
|
411
493
|
* The info segments as they fit `width`: an `age` (`5m ago`) is left out
|
|
412
494
|
* first, so the source and the date outlast it; then segments with `variants` step down
|
|
@@ -414,10 +496,13 @@ function trimTrailing(info: PaneFooterSegment[], width: number, keep: number, pa
|
|
|
414
496
|
* the hints, the trailing status that still does not fit is then cut or left
|
|
415
497
|
* out (trimTrailing). A status after every segment with shorter forms gives
|
|
416
498
|
* way first, before any of them shortens: a pane puts what goes first last
|
|
417
|
-
* (an update time after a note that explains the row in hand).
|
|
499
|
+
* (an update time after a note that explains the row in hand). A note line
|
|
500
|
+
* takes the room the rest leaves it (fitNoteLines).
|
|
418
501
|
*
|
|
419
|
-
* With no hints beside it
|
|
420
|
-
*
|
|
502
|
+
* With no hints beside it, a pane picture's footer clips the rest, so a
|
|
503
|
+
* frame that fits its own status line sees it overflow; the terminal's (a
|
|
504
|
+
* pane not focused) cuts or leaves out the trailing status as it does beside
|
|
505
|
+
* the hints, so no segment ends mid-word.
|
|
421
506
|
*/
|
|
422
507
|
export function fitPaneFooterInfo(
|
|
423
508
|
info: PaneFooterSegment[],
|
|
@@ -428,7 +513,19 @@ export function fitPaneFooterInfo(
|
|
|
428
513
|
if (infoTextWidth(info) > width && info.some((segment) => segment.age)) {
|
|
429
514
|
return fitPaneFooterInfo(info.filter((segment) => !segment.age), width, { besideHints, terminal });
|
|
430
515
|
}
|
|
431
|
-
if (
|
|
516
|
+
if (info.some(isNoteLine)) {
|
|
517
|
+
// The rest fits beside the share a note line keeps; the note line then takes what they leave.
|
|
518
|
+
const held = info.map((segment): PaneFooterSegment => isNoteLine(segment) ? {
|
|
519
|
+
...segment,
|
|
520
|
+
notes: undefined,
|
|
521
|
+
parts: [{ text: " ".repeat(Math.min(partsWidth(noteLineParts(segment.notes!, Number.POSITIVE_INFINITY)), Math.floor(width * NOTE_LINE_SHARE))),
|
|
522
|
+
tone: "warning" }],
|
|
523
|
+
} : segment);
|
|
524
|
+
const notesOf = new Map(info.filter(isNoteLine).map((segment) => [segment.id, segment.notes!]));
|
|
525
|
+
return fitNoteLines(fitPaneFooterInfo(held, width, { besideHints, terminal })
|
|
526
|
+
.map((segment) => notesOf.has(segment.id) ? { ...segment, notes: notesOf.get(segment.id) } : segment), width);
|
|
527
|
+
}
|
|
528
|
+
if (!besideHints && !terminal) return stepDownTogether(info, width);
|
|
432
529
|
const lastWithVariants = info.findLastIndex((segment) => (segment.variants?.length ?? 0) > 0);
|
|
433
530
|
if (lastWithVariants >= 0 && lastWithVariants < info.length - 1 && infoTextWidth(info) > width) {
|
|
434
531
|
const trimmed = trimTrailing(info, width, lastWithVariants + 1, terminal);
|
|
@@ -437,10 +534,15 @@ export function fitPaneFooterInfo(
|
|
|
437
534
|
return trimTrailing(stepDownTogether(info, width), width, 1, terminal);
|
|
438
535
|
}
|
|
439
536
|
|
|
440
|
-
/**
|
|
441
|
-
|
|
537
|
+
/**
|
|
538
|
+
* A segment cut after its last whole word that fits `width`, behind an
|
|
539
|
+
* ellipsis, each part keeping its tone; the full text stays as its title.
|
|
540
|
+
* Null when not even its first word fits: a word is never cut.
|
|
541
|
+
*/
|
|
542
|
+
function clipSegment(segment: PaneFooterSegment, width: number): PaneFooterSegment | null {
|
|
442
543
|
const full = segment.parts.map((part) => part.text).join(" ");
|
|
443
|
-
const clipped =
|
|
544
|
+
const clipped = cutAtWord(full, width);
|
|
545
|
+
if (!clipped) return null;
|
|
444
546
|
if (clipped === full) return segment;
|
|
445
547
|
const body = clipped.slice(0, -1);
|
|
446
548
|
const parts: PaneFooterPart[] = [];
|
|
@@ -683,6 +785,10 @@ export function samePaneFooterRegistration(
|
|
|
683
785
|
&& segment.disabled === other.disabled
|
|
684
786
|
&& segment.savedCopyAt === other.savedCopyAt
|
|
685
787
|
&& segment.age === other.age
|
|
788
|
+
&& !!segment.capture === !!other.capture && !!segment.holdsPlace === !!other.holdsPlace
|
|
789
|
+
// The icon reads the same whatever its notes say; a picture of the pane prints them.
|
|
790
|
+
&& (segment.notes ?? []).length === (other.notes ?? []).length
|
|
791
|
+
&& (segment.notes ?? []).every((note, noteIndex) => note === other.notes![noteIndex])
|
|
686
792
|
&& sameFooterParts(segment.parts, other.parts)
|
|
687
793
|
&& (segment.variants?.length ?? 0) === (other.variants?.length ?? 0)
|
|
688
794
|
&& (segment.variants ?? []).every((variant, variantIndex) => sameFooterParts(variant, other.variants![variantIndex]!));
|
|
@@ -29,6 +29,17 @@ export const PANE_HEADER_ASK_MIN_WIDTH = 32;
|
|
|
29
29
|
export const PANE_HEADER_RESTORE = " - ";
|
|
30
30
|
const PANE_HEADER_LOCK = " 🔒 ";
|
|
31
31
|
const HIDDEN_HEADER_BUTTON = { visibility: "hidden" } as const;
|
|
32
|
+
/**
|
|
33
|
+
* Desktop and web: how far the active title-bar tab reaches past the header's
|
|
34
|
+
* bottom rule into the pane. A strip wider than its pane scrolls, and WebKit
|
|
35
|
+
* (the macOS app, Safari) draws a scrolling box as a layer of its own that it
|
|
36
|
+
* places on a whole device pixel: in a title bar that sits a fraction of a
|
|
37
|
+
* pixel off the grid (a pane moved or split to a fraction of a cell), the tab
|
|
38
|
+
* then ends a device pixel above the rule and the rule's last row shows under
|
|
39
|
+
* it. Reaching a pixel past the rule, the tab still covers it, and the part
|
|
40
|
+
* in the pane is the colour of what is under it.
|
|
41
|
+
*/
|
|
42
|
+
const HEADER_TAB_OVERHANG_PX = 1;
|
|
32
43
|
/** Terminal: between two tabs of a stack, and the most of a title one tab shows. */
|
|
33
44
|
const STACK_TAB_SEPARATOR = " │ ";
|
|
34
45
|
const STACK_TAB_MAX_WIDTH = 16;
|
|
@@ -447,14 +458,17 @@ export function PaneHeader({
|
|
|
447
458
|
// Focused, the rule is the accent; otherwise the one hairline.
|
|
448
459
|
const ruleColor = visuallyFocused ? colors.borderFocused : "var(--gloom-hairline)";
|
|
449
460
|
// Title-bar tabs, the pane's own and a stack's alike: the strip hangs over
|
|
450
|
-
// the header's rules
|
|
461
|
+
// the header's rules, and past the bottom one into the pane, so the active
|
|
462
|
+
// tab's box opens into the pane (styles.css).
|
|
451
463
|
const headerTabStripStyle = {
|
|
452
464
|
alignSelf: "stretch",
|
|
453
465
|
marginTop: -topInset,
|
|
454
|
-
marginBottom: -1,
|
|
466
|
+
marginBottom: -(1 + HEADER_TAB_OVERHANG_PX),
|
|
455
467
|
// Undoes the negative top margin for what is centred in the strip:
|
|
456
468
|
// the overflow chevron, and the tab labels (styles.css).
|
|
457
469
|
"--pane-tab-top-inset": `${topInset}px`,
|
|
470
|
+
// How far the active tab reaches past the rule into the pane.
|
|
471
|
+
"--pane-tab-overhang": `${HEADER_TAB_OVERHANG_PX}px`,
|
|
458
472
|
// The active tab's box opens into the pane over the bottom rule
|
|
459
473
|
// (styles.css), drawn in the rule's colour so the two are one line.
|
|
460
474
|
"--pane-tab-border": ruleColor,
|
|
@@ -4,6 +4,7 @@ import type { CompanyFrom } from "../../../types/company-from";
|
|
|
4
4
|
import { useAppLanguage } from "../../../i18n/react";
|
|
5
5
|
import { useExternalLinkFooter } from "../../use-external-link-footer";
|
|
6
6
|
import { loadingErrorFooterInfo } from "../../data-table/table-pane";
|
|
7
|
+
import { useRemoteUiNode } from "../../../remote/semantic-tree";
|
|
7
8
|
|
|
8
9
|
const EMPTY_STATUS_INFO: PaneFooterSegment[] = [];
|
|
9
10
|
|
|
@@ -64,16 +65,33 @@ export function useCompanyDataFooter(companyFrom: CompanyFrom | null | undefined
|
|
|
64
65
|
);
|
|
65
66
|
}
|
|
66
67
|
|
|
68
|
+
/**
|
|
69
|
+
* A load that failed, published for the pane's report (`gloom fn`): the
|
|
70
|
+
* footer says it in the app, and a report of a pane with nothing else to
|
|
71
|
+
* show fails with it, as the plain commands do, instead of reading back the
|
|
72
|
+
* empty body ("No events") as the data and dating it (`pane-load-error`).
|
|
73
|
+
*/
|
|
74
|
+
function usePaneLoadErrorNode(loading: boolean, error: string | null | undefined, enabled = true) {
|
|
75
|
+
const message = !loading && enabled ? error?.trim() ?? "" : "";
|
|
76
|
+
useRemoteUiNode(message ? {
|
|
77
|
+
role: "pane-load-error",
|
|
78
|
+
label: "Load failed",
|
|
79
|
+
getMetadata: () => ({ message }),
|
|
80
|
+
} : null);
|
|
81
|
+
}
|
|
82
|
+
|
|
67
83
|
export function usePaneStatusFooter({
|
|
68
84
|
registrationId,
|
|
69
85
|
loading = false,
|
|
70
86
|
error,
|
|
87
|
+
emptyResult = false,
|
|
71
88
|
stale = false,
|
|
72
89
|
info = EMPTY_STATUS_INFO,
|
|
73
90
|
hints,
|
|
74
91
|
enabled = true,
|
|
75
92
|
}: PaneStatusInfoOptions & {
|
|
76
93
|
registrationId: string;
|
|
94
|
+
emptyResult?: boolean;
|
|
77
95
|
hints?: PaneHint[];
|
|
78
96
|
enabled?: boolean;
|
|
79
97
|
}) {
|
|
@@ -81,6 +99,11 @@ export function usePaneStatusFooter({
|
|
|
81
99
|
() => buildPaneStatusInfo({ loading, error, stale, info }),
|
|
82
100
|
[error, info, loading, stale],
|
|
83
101
|
);
|
|
102
|
+
usePaneLoadErrorNode(loading, error, enabled);
|
|
103
|
+
useRemoteUiNode(enabled && emptyResult && !loading && !error ? {
|
|
104
|
+
role: "pane-empty-result",
|
|
105
|
+
label: "No results",
|
|
106
|
+
} : null);
|
|
84
107
|
usePaneFooter(
|
|
85
108
|
registrationId,
|
|
86
109
|
() => enabled && (statusInfo.length > 0 || (hints?.length ?? 0) > 0)
|
|
@@ -115,6 +138,7 @@ export function usePaneStatusLinkFooter({
|
|
|
115
138
|
() => buildPaneStatusInfo({ loading, error, stale, info }),
|
|
116
139
|
[error, info, loading, stale],
|
|
117
140
|
);
|
|
141
|
+
usePaneLoadErrorNode(loading, error);
|
|
118
142
|
return useExternalLinkFooter({
|
|
119
143
|
registrationId,
|
|
120
144
|
focused,
|
|
@@ -85,6 +85,8 @@ export interface MarketBoardStackProps<T extends MarketBoardRow> {
|
|
|
85
85
|
*/
|
|
86
86
|
rootBefore?: ReactNode | ((board: { columns: readonly DataTableColumn[] }) => ReactNode);
|
|
87
87
|
emptyTitle?: string;
|
|
88
|
+
/** What concerns one row (it has no figure, its figure is old), under the board while it is selected (DataTableView `rowNote`). */
|
|
89
|
+
rowNote?: (row: T) => string | null;
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
/**
|
|
@@ -152,7 +154,7 @@ function fitBoardColumns(candidates: DataTableColumn[], width: number, wordWidth
|
|
|
152
154
|
export function MarketBoardStack<T extends MarketBoardRow>({ rows, width, height, focused,
|
|
153
155
|
selectedId, onSelectedIdChange, openId, onOpenIdChange, renderDetail, changeLabel = "1D", valueWidth = 12,
|
|
154
156
|
labelWidth = 18, labelHeader = "INSTRUMENT", labelDetailHeader = "DETAIL", labelDetailWidth = 22, valueLabel = "LEVEL", percentileLabel = "PCTL 1Y", asOfWidth = 10, signedChange = false, extraColumns,
|
|
155
|
-
rootBefore, emptyTitle = "No observations." }: MarketBoardStackProps<T>) {
|
|
157
|
+
rootBefore, emptyTitle = "No observations.", rowNote }: MarketBoardStackProps<T>) {
|
|
156
158
|
const colors = useThemeColors();
|
|
157
159
|
// A board of countries leads each name with its flag where one is drawn.
|
|
158
160
|
const flagged = useUiCapabilities().nativePaneChrome === true && rows.some((row) => row.country !== undefined);
|
|
@@ -206,7 +208,7 @@ export function MarketBoardStack<T extends MarketBoardRow>({ rows, width, height
|
|
|
206
208
|
sortColumnId={sort.columnId} sortDirection={sort.direction} onHeaderClick={(id) => {
|
|
207
209
|
if (id !== "history") setSort((current) => nextHeaderSort(current, id));
|
|
208
210
|
}} rootWidth={width} rootHeight={Math.max(3, height)} rootBefore={typeof rootBefore === "function" ? rootBefore({ columns }) : rootBefore}
|
|
209
|
-
freezeFirstColumn emptyStateTitle={emptyTitle} />;
|
|
211
|
+
freezeFirstColumn emptyStateTitle={emptyTitle} {...(rowNote ? { rowNote: (row: T) => rowNote(row) } : {})} />;
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
export interface StatChartDetailProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RADIUS, SPACE } from "../../theme/ui-tokens";
|
|
2
|
-
import type
|
|
2
|
+
import { useEffect, type ReactNode } from "react";
|
|
3
3
|
import { Box, Text, TextAttributes, useUiCapabilities } from "../../ui";
|
|
4
4
|
import { useViewport } from "../../react/input";
|
|
5
5
|
import { blendHex } from "../../theme/colors";
|
|
@@ -10,6 +10,7 @@ import type { ButtonProps } from "../ui/button";
|
|
|
10
10
|
import { ListRowLines } from "../ui/list-row-lines";
|
|
11
11
|
import { TITLEBAR_OVERLAY_HEIGHT_PX } from "../layout/titlebar-overlay";
|
|
12
12
|
import { RemoteSurface, useRemoteSurfaceHeader, useRemoteSurfaceHeading } from "../../remote/surface";
|
|
13
|
+
import { holdSetupCard } from "./setup-cards";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Spacing for the DOM card, in px. The card is a form the user fills in, not
|
|
@@ -58,6 +59,8 @@ export function OnboardingModal({
|
|
|
58
59
|
const colors = useThemeColors();
|
|
59
60
|
const desktop = useUiCapabilities().nativePaneChrome === true;
|
|
60
61
|
const viewport = useViewport();
|
|
62
|
+
// Up while drawn, so a card that must not open over it can wait (setup-cards.ts).
|
|
63
|
+
useEffect(() => holdSetupCard(), []);
|
|
61
64
|
|
|
62
65
|
// It covers the app, so remote control reads it as the open form.
|
|
63
66
|
const content = <RemoteSurface kind="setup">{children}</RemoteSurface>;
|
|
@@ -533,7 +536,8 @@ export function OnboardingChoiceList({
|
|
|
533
536
|
onActivate={(_item, index) => onActivate(index)}
|
|
534
537
|
surface="framed"
|
|
535
538
|
rowGap={0}
|
|
536
|
-
|
|
539
|
+
// Two lines where a choice says more under its name; one where none does.
|
|
540
|
+
rowHeight={items.some((item) => item.description) ? 2 : 1}
|
|
537
541
|
selectOnHover
|
|
538
542
|
renderRow={(item, state) => (
|
|
539
543
|
<Box flexDirection="row" alignItems="center" width="100%" minWidth={0}>
|
|
@@ -168,6 +168,12 @@ export function useOnboardingKeyboard({
|
|
|
168
168
|
const sectionDigit = !chord && !editingField && !event.targetEditable ? SECTION_DIGITS[name] : undefined;
|
|
169
169
|
|
|
170
170
|
const handled = ((): boolean => {
|
|
171
|
+
if (!chord && name === "escape" && stage === "portfolio" && portfolioSub === "positions" && !isBrokerCommitting) {
|
|
172
|
+
if (editingField) setEditingField(false);
|
|
173
|
+
else if (positionCount === 0 && !progress.rerun) skipPositions();
|
|
174
|
+
else skipSetup();
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
171
177
|
if (isPlainKey(event, "f10")) {
|
|
172
178
|
// "Which tickers do you follow?" is skipped from its search field too.
|
|
173
179
|
if (stage === "tickers") {
|
|
@@ -303,7 +309,7 @@ export function useOnboardingKeyboard({
|
|
|
303
309
|
const desk = DESKS[deskCursor];
|
|
304
310
|
if (chosenDesks.length > 0) finishDesks(chosenDesks);
|
|
305
311
|
else if (desk) setChosenDesks((current) => toggleDeskChoice(current, desk.key));
|
|
306
|
-
} else if (letter(SKIP_DESKS_KEY)) {
|
|
312
|
+
} else if (letter(SKIP_DESKS_KEY) || (!chord && name === "escape")) {
|
|
307
313
|
finishDesks([]);
|
|
308
314
|
} else if (!chord && (name === "up" || name === "k")) {
|
|
309
315
|
setDeskCursor((index) => Math.max(0, index - 1));
|
|
@@ -301,7 +301,9 @@ function useOnboardingWizard({ pluginRegistry, importBrokerPositions, onComplete
|
|
|
301
301
|
? findPaneInstance(config.layout, focusedPaneId)
|
|
302
302
|
: null;
|
|
303
303
|
const helpFocused = focusedInstance?.paneId === "help";
|
|
304
|
-
|
|
304
|
+
// The command bar its "Ctrl+P adds more" opens is the card's own next step:
|
|
305
|
+
// the card steps aside while it is open, as for a pane opened after it.
|
|
306
|
+
const coachAside = useCoachStepsAside(config, stage) || (stage === "research" && commandBarOpen);
|
|
305
307
|
const {
|
|
306
308
|
offer, pricing, billingInterval, setBillingInterval, planAccess, primaryUpgradeAction, continueFree,
|
|
307
309
|
} = useOnboardingUpgrade({
|
|
@@ -5,6 +5,8 @@ import { shownPriceColor } from "../../../theme/colors";
|
|
|
5
5
|
import { t, tf } from "../../../i18n";
|
|
6
6
|
import { formatMarketPrice } from "../../../market-data/market/format";
|
|
7
7
|
import { getRegularSessionDisplay } from "../../../market-data/market/status";
|
|
8
|
+
import { regularSessionValuationTime } from "../../../market-data/quotes/regular-session-valuation";
|
|
9
|
+
import { formatUtcTime } from "../../../utils/utc-time";
|
|
8
10
|
import { formatPercentRaw } from "../../../utils/format";
|
|
9
11
|
import { Button, NumberField, Prose, TextField } from "../../ui";
|
|
10
12
|
import { DelayedMark } from "../../ui/delayed-mark";
|
|
@@ -67,19 +69,28 @@ function PreviewLine({ preview, error }: Pick<OnboardingPositionsState, "preview
|
|
|
67
69
|
const change = headline?.changePercent;
|
|
68
70
|
// Only the name gives way to a narrow row, clipped on its right: the symbol, price and move keep every cell.
|
|
69
71
|
return (
|
|
70
|
-
<Box flexDirection="
|
|
71
|
-
<Box
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
<Box flexDirection="column" minWidth={0} flexShrink={0}>
|
|
73
|
+
<Box flexDirection="row" alignItems="center" minWidth={0} overflow="hidden">
|
|
74
|
+
<Box flexShrink={0}><Text fg={colors.text} attributes={TextAttributes.BOLD}>{preview.symbol}</Text></Box>
|
|
75
|
+
{preview.name ? (
|
|
76
|
+
<Box flexShrink={1} minWidth={0} overflow="hidden" paddingLeft={2}><Text fg={colors.textDim}>{preview.name}</Text></Box>
|
|
77
|
+
) : null}
|
|
78
|
+
{price != null ? <Box flexShrink={0} paddingLeft={2}><Text fg={colors.text}>{formatMarketPrice(price, { maxWidth: 12 })}</Text></Box> : null}
|
|
79
|
+
{change != null ? <Box flexShrink={0} paddingLeft={1}><Text fg={shownPriceColor(change, 2, colors)}>{formatPercentRaw(change)}</Text></Box> : null}
|
|
80
|
+
{price != null && delay != null ? <Box flexShrink={0} paddingLeft={1}><DelayedMark minutes={delay} /></Box> : null}
|
|
81
|
+
{preview.duplicate ? <Box flexShrink={0}><Text fg={colors.textMuted}>{t(" already added")}</Text></Box> : null}
|
|
82
|
+
</Box>
|
|
83
|
+
{price != null ? <Text fg={colors.textDim} wrapText>{previewTime(preview)}</Text> : null}
|
|
79
84
|
</Box>
|
|
80
85
|
);
|
|
81
86
|
}
|
|
82
87
|
|
|
88
|
+
function previewTime(preview: OnboardingPositionsState["preview"]): string {
|
|
89
|
+
if (preview.status !== "ready") return "";
|
|
90
|
+
const time = regularSessionValuationTime(preview.quote);
|
|
91
|
+
return time ? `As of ${formatUtcTime(time)}` : "Price time unavailable";
|
|
92
|
+
}
|
|
93
|
+
|
|
83
94
|
const wholeCurrencyFormatters = new Map<string, Intl.NumberFormat>();
|
|
84
95
|
|
|
85
96
|
/** Position value rounded to whole units: cents add noise next to a share count. */
|
|
@@ -280,11 +291,6 @@ function TuiFieldRow({
|
|
|
280
291
|
<Text fg={value ? colors.text : colors.textMuted}>{value || fieldPlaceholder(field, state)}</Text>
|
|
281
292
|
)}
|
|
282
293
|
</Box>
|
|
283
|
-
{field === "ticker" ? (
|
|
284
|
-
<Box flexGrow={1} minWidth={0} overflow="hidden" paddingLeft={1}>
|
|
285
|
-
<PreviewLine preview={state.preview} error={null} />
|
|
286
|
-
</Box>
|
|
287
|
-
) : null}
|
|
288
294
|
{/* The form's last field ends in Add, as the desktop's row does, so a mouse adds the row without Enter. */}
|
|
289
295
|
{index === POSITION_FIELDS.length - 1 ? (
|
|
290
296
|
<Box flexShrink={0} paddingLeft={1}>
|
|
@@ -332,7 +338,9 @@ function tuiPositionsNote(state: OnboardingPositionsState, editing: boolean): st
|
|
|
332
338
|
*/
|
|
333
339
|
export function tuiPositionsPanelRows(state: OnboardingPositionsState, editing: boolean, width: number): number {
|
|
334
340
|
const noteRows = wrapTextLines(tuiPositionsNote(state, editing), tuiNoteWidth(width)).length;
|
|
335
|
-
|
|
341
|
+
const previewRows = state.preview.status === "idle" ? 0
|
|
342
|
+
: state.preview.status === "ready" ? 1 + wrapTextLines(previewTime(state.preview), tuiNoteWidth(width)).length : 1;
|
|
343
|
+
return POSITION_FIELDS.length + previewRows + noteRows + 4 + Math.min(state.positions.length, TUI_VISIBLE_ROWS);
|
|
336
344
|
}
|
|
337
345
|
|
|
338
346
|
function TuiPositionsPanel({ state, inputRef, editing, selectedSymbol, shortcut, columns }: PositionsPanelProps) {
|
|
@@ -347,6 +355,7 @@ function TuiPositionsPanel({ state, inputRef, editing, selectedSymbol, shortcut,
|
|
|
347
355
|
{POSITION_FIELDS.map((field, index) => (
|
|
348
356
|
<TuiFieldRow key={field} field={field} index={index} state={state} inputRef={inputRef} editing={editing} />
|
|
349
357
|
))}
|
|
358
|
+
<PreviewLine preview={state.preview} error={null} />
|
|
350
359
|
{/* Wraps in a narrow window (64 columns) rather than cutting how the step goes on, at the words the
|
|
351
360
|
card's height counted (tuiPositionsPanelRows), so the card holds every line it draws. */}
|
|
352
361
|
<Box flexShrink={0} flexDirection="column">
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a full-window setup card is up: the first-run setup, "Which
|
|
3
|
+
* companies do you follow?" after a sign-up, or any other card drawn with
|
|
4
|
+
* OnboardingModal. They are not dialogs of the dialog stack, so a surface that
|
|
5
|
+
* must not open over one of them (the question after a sign-up) reads this.
|
|
6
|
+
*/
|
|
7
|
+
let openCards = 0;
|
|
8
|
+
const listeners = new Set<() => void>();
|
|
9
|
+
|
|
10
|
+
function changed() {
|
|
11
|
+
for (const listener of listeners) listener();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Counts a card as up until the returned release is called (once). */
|
|
15
|
+
export function holdSetupCard(): () => void {
|
|
16
|
+
openCards += 1;
|
|
17
|
+
changed();
|
|
18
|
+
let released = false;
|
|
19
|
+
return () => {
|
|
20
|
+
if (released) return;
|
|
21
|
+
released = true;
|
|
22
|
+
openCards -= 1;
|
|
23
|
+
changed();
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function setupCardOpen(): boolean {
|
|
28
|
+
return openCards > 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function subscribeSetupCards(listener: () => void): () => void {
|
|
32
|
+
listeners.add(listener);
|
|
33
|
+
return () => {
|
|
34
|
+
listeners.delete(listener);
|
|
35
|
+
};
|
|
36
|
+
}
|