gloomberb 0.10.4 → 0.11.0
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/LICENSE +1 -1
- package/README.md +30 -3
- package/README.zh-CN.md +1 -1
- package/package.json +5 -5
- package/src/api-client/auth.ts +34 -0
- package/src/api-client/data.ts +25 -0
- package/src/api-client/index.test.ts +81 -0
- package/src/api-client/index.ts +37 -0
- package/src/api-client/request.test.ts +30 -0
- package/src/api-client/request.ts +44 -20
- package/src/api-client/socket-health.test.ts +79 -0
- package/src/api-client/socket.ts +108 -5
- package/src/api-client/types.ts +139 -0
- package/src/app/global-shortcuts.test.tsx +144 -9
- package/src/app/global-shortcuts.ts +33 -11
- package/src/app/runtime/broker-import.ts +39 -5
- package/src/app/runtime/startup.ts +7 -1
- package/src/app/runtime/update.ts +26 -1
- package/src/app.tsx +36 -19
- package/src/brokers/broker-ticker-sync.ts +3 -8
- package/src/brokers/sync-broker-instance.test.ts +59 -0
- package/src/brokers/sync-broker-instance.ts +37 -13
- package/src/capabilities/chart-series.ts +318 -0
- package/src/capabilities/factories.ts +46 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/registry.test.ts +135 -0
- package/src/capabilities/registry.ts +31 -4
- package/src/capabilities/types.ts +52 -0
- package/src/cli/commands/overview.ts +2 -2
- package/src/cli/desktop-pane-shot.ts +2 -0
- package/src/cli/entry.ts +11 -1
- package/src/cli/native-smoke.ts +5 -0
- package/src/cli/pane-functions/catalog.ts +4 -0
- package/src/cli/pane-functions/data.ts +6 -1
- package/src/cli/pane-functions/discovery.ts +76 -10
- package/src/cli/pane-functions/report.test.ts +76 -0
- package/src/cli/pane-functions/report.ts +7 -1
- package/src/cli/pane-functions/resolver.ts +4 -1
- package/src/cli/pane-functions/screenshot.test.ts +56 -3
- package/src/cli/pane-functions/screenshot.ts +68 -5
- package/src/components/chart/composite/composite-chart.test.tsx +54 -0
- package/src/components/chart/composite/composite-chart.tsx +92 -15
- package/src/components/chart/composite/downsample.test.ts +136 -0
- package/src/components/chart/composite/downsample.ts +208 -0
- package/src/components/chart/composite/panel-series.test.ts +66 -0
- package/src/components/chart/composite/panel-series.ts +101 -0
- package/src/components/chart/multi-line/renderer.ts +1 -0
- package/src/components/chart/native/kitty/index.test.ts +25 -3
- package/src/components/chart/native/kitty/support.ts +37 -3
- package/src/components/chart/native/use-chart-text-fallback.ts +19 -0
- package/src/components/chart/static/chart/surface.tsx +43 -12
- package/src/components/chart/static/multi-line-chart-surface.tsx +41 -5
- package/src/components/command-bar/commands/direct/index.ts +18 -0
- package/src/components/command-bar/commands/registry.ts +14 -0
- package/src/components/command-bar/routes/root/article-results.test.ts +83 -0
- package/src/components/command-bar/routes/root/article-results.ts +55 -0
- package/src/components/command-bar/routes/root/command-items.ts +3 -0
- package/src/components/command-bar/routes/root/provider-search.ts +7 -3
- package/src/components/command-bar/routes/root/results.ts +38 -11
- package/src/components/command-bar/routes/root/runtime.ts +6 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +1 -1
- package/src/components/command-bar/routes/ticker-search/results.test.ts +34 -0
- package/src/components/command-bar/routes/ticker-search/results.ts +4 -6
- package/src/components/command-bar/routes/ticker-search/route.ts +2 -2
- package/src/components/command-bar/routing/list-state.ts +2 -1
- package/src/components/command-bar/surface/assist.test.tsx +13 -6
- package/src/components/command-bar/surface/index.test.tsx +65 -0
- package/src/components/command-bar/surface/index.tsx +35 -0
- package/src/components/command-bar/view-model.test.ts +43 -0
- package/src/components/command-bar/view-model.ts +41 -4
- package/src/components/command-bar/workflow/collection-actions.test.ts +94 -0
- package/src/components/command-bar/workflow/collection-actions.ts +14 -3
- package/src/components/command-bar/workflow/ops.test.ts +136 -0
- package/src/components/command-bar/workflow/ops.ts +71 -1
- package/src/components/index.ts +1 -1
- package/src/components/layout/header.test.tsx +35 -0
- package/src/components/layout/header.tsx +101 -9
- package/src/components/layout/pane/cycle-order.test.ts +0 -1
- package/src/components/layout/pane/footer/index.test.tsx +19 -19
- package/src/components/layout/pane/header.tsx +2 -13
- package/src/components/layout/shell/index.tsx +3 -0
- package/src/components/layout/status-bar.test.tsx +36 -1
- package/src/components/layout/status-bar.tsx +48 -2
- package/src/components/onboarding/account-step/chooser-panel.tsx +27 -50
- package/src/components/onboarding/account-step/form-panel.tsx +85 -29
- package/src/components/onboarding/account-step/index.tsx +10 -1
- package/src/components/onboarding/account-step/model.ts +3 -3
- package/src/components/onboarding/account-step/qr-panel.tsx +68 -0
- package/src/components/onboarding/account-step/signed-in-panel.tsx +4 -7
- package/src/components/onboarding/onboarding-frame.tsx +517 -0
- package/src/components/onboarding/onboarding-steps.tsx +0 -264
- package/src/components/onboarding/onboarding-wizard.test.tsx +626 -200
- package/src/components/onboarding/onboarding-wizard.tsx +848 -266
- package/src/components/onboarding/portfolio-step/broker-fields-panel.tsx +81 -51
- package/src/components/onboarding/portfolio-step/broker-setup-panel.tsx +14 -20
- package/src/components/onboarding/portfolio-step/broker-sync-panel.tsx +8 -11
- package/src/components/onboarding/portfolio-step/choose-panel.tsx +18 -22
- package/src/components/onboarding/portfolio-step/index.tsx +3 -0
- package/src/components/onboarding/portfolio-step/types.ts +3 -0
- package/src/components/onboarding/wizard-account.ts +38 -3
- package/src/components/onboarding/wizard-broker-sync.ts +45 -67
- package/src/components/onboarding/wizard-model.ts +18 -2
- package/src/components/ui/data-table/opentui/index.tsx +29 -9
- package/src/components/ui/data-table/types.ts +2 -0
- package/src/components/ui/external-link.tsx +4 -2
- package/src/components/ui/loading.tsx +1 -1
- package/src/components/ui/status.tsx +76 -4
- package/src/components/ui/table-layout.test.ts +24 -0
- package/src/components/ui/table-layout.ts +90 -23
- package/src/components/ui/tabs.tsx +86 -4
- package/src/core/app-services.ts +14 -3
- package/src/core/connection-health.test.ts +143 -0
- package/src/core/connection-health.ts +295 -0
- package/src/core/state/app/layout-reducer.ts +34 -0
- package/src/core/state/app/layout.ts +21 -0
- package/src/core/state/app/state.ts +10 -0
- package/src/core/state/app/types.ts +7 -1
- package/src/data/config/chart-settings.ts +11 -2
- package/src/data/config/store/index.test.ts +83 -9
- package/src/data/config/store/migrations.ts +16 -0
- package/src/data/config/store/normalize.ts +59 -1
- package/src/data/fred-series.ts +8 -2
- package/src/i18n/es.ts +126 -0
- package/src/i18n/ja.ts +126 -0
- package/src/i18n/ko.ts +126 -0
- package/src/i18n/zh-cn.ts +126 -0
- package/src/i18n/zh-tw.ts +126 -0
- package/src/market-data/coordinator/chart.ts +3 -2
- package/src/market-data/hooks.tsx +3 -2
- package/src/market-data/market/status.test.ts +12 -0
- package/src/market-data/market/status.ts +34 -17
- package/src/news/aggregator.test.ts +39 -0
- package/src/news/aggregator.ts +78 -22
- package/src/news/hooks.ts +4 -0
- package/src/notifications/app-notifier.test.ts +28 -6
- package/src/notifications/app-notifier.ts +24 -5
- package/src/plugins/broker-sync/broker-sync.test.ts +130 -0
- package/src/plugins/broker-sync/native-loader.ts +10 -0
- package/src/plugins/broker-sync/normalize.ts +271 -0
- package/src/plugins/broker-sync/public.ts +122 -0
- package/src/plugins/broker-sync/robinhood-native.ts +367 -0
- package/src/plugins/broker-sync/robinhood.ts +114 -0
- package/src/plugins/broker-sync/simplefin-native.ts +201 -0
- package/src/plugins/broker-sync/simplefin.ts +70 -0
- package/src/plugins/builtin/account-management/footer.ts +8 -19
- package/src/plugins/builtin/account-management/pane.tsx +13 -8
- package/src/plugins/builtin/ai/pi/host.ts +6 -5
- package/src/plugins/builtin/ai/providers.ts +1 -1
- package/src/plugins/builtin/ai/screener/footer.ts +0 -7
- package/src/plugins/builtin/ai/screener/pane.test.tsx +2 -1
- package/src/plugins/builtin/ai/screener/pane.tsx +3 -1
- package/src/plugins/builtin/ai/screener/results-view.tsx +8 -0
- package/src/plugins/builtin/ai/screener/runner.ts +7 -3
- package/src/plugins/builtin/ai/workspace/pane.tsx +13 -2
- package/src/plugins/builtin/alerts/alert-engine.ts +13 -0
- package/src/plugins/builtin/alerts/constants.ts +2 -1
- package/src/plugins/builtin/alerts/index.tsx +67 -36
- package/src/plugins/builtin/alerts/pane.tsx +17 -65
- package/src/plugins/builtin/analytics/index.tsx +24 -11
- package/src/plugins/builtin/analytics/pane-model.ts +48 -14
- package/src/plugins/builtin/analytics/portfolio-selection.ts +19 -0
- package/src/plugins/builtin/analytics/view.tsx +5 -3
- package/src/plugins/builtin/broker-manager/detail.tsx +7 -2
- package/src/plugins/builtin/broker-manager/footer.ts +4 -9
- package/src/plugins/builtin/broker-manager/index.tsx +1 -6
- package/src/plugins/builtin/buildout/detail/ui.tsx +15 -4
- package/src/plugins/builtin/buildout/pane/header.tsx +1 -0
- package/src/plugins/builtin/changelog/index.tsx +60 -45
- package/src/plugins/builtin/chart-composer/catalog-inventory.test.ts +97 -0
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +366 -0
- package/src/plugins/builtin/chart-composer/chart-spec.ts +21 -1
- package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +307 -0
- package/src/plugins/builtin/chart-composer/editor/controller.ts +1 -1
- package/src/plugins/builtin/chart-composer/index.tsx +45 -5
- package/src/plugins/builtin/chart-composer/pane.tsx +7 -88
- package/src/plugins/builtin/chart-composer/presets.test.ts +48 -0
- package/src/plugins/builtin/chart-composer/presets.ts +69 -3
- package/src/plugins/builtin/chart-composer/quick-add.tsx +8 -5
- package/src/plugins/builtin/chart-composer/semantic.ts +18 -14
- package/src/plugins/builtin/chart-composer/series-catalog.test.ts +39 -0
- package/src/plugins/builtin/chart-composer/series-catalog.ts +104 -3
- package/src/plugins/builtin/chart-composer/shortcuts.test.ts +10 -10
- package/src/plugins/builtin/chart-composer/shortcuts.ts +4 -12
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +230 -23
- package/src/plugins/builtin/chat/chat.test.tsx +22 -0
- package/src/plugins/builtin/chat/content/composer.tsx +6 -4
- package/src/plugins/builtin/chat/content/index.tsx +7 -0
- package/src/plugins/builtin/chat/content/snapshot.ts +9 -2
- package/src/plugins/builtin/chat/content/transcript.tsx +10 -0
- package/src/plugins/builtin/chat/controller/channel-actions.ts +11 -1
- package/src/plugins/builtin/chat/controller/channels.ts +13 -3
- package/src/plugins/builtin/chat/controller/index.ts +61 -7
- package/src/plugins/builtin/chat/controller/lifecycle.ts +3 -0
- package/src/plugins/builtin/chat/controller/message-loading.ts +5 -1
- package/src/plugins/builtin/chat/controller/messages.ts +3 -1
- package/src/plugins/builtin/chat/controller/notifications.ts +32 -11
- package/src/plugins/builtin/chat/controller/state.ts +7 -0
- package/src/plugins/builtin/chat/controller/view.ts +1 -0
- package/src/plugins/builtin/chat/controller.test.ts +117 -28
- package/src/plugins/builtin/cloud/auth-commands.ts +18 -0
- package/src/plugins/builtin/cloud/device-signin-dialog.tsx +243 -0
- package/src/plugins/builtin/cloud/device-signin.test.ts +217 -0
- package/src/plugins/builtin/cloud/device-signin.ts +240 -0
- package/src/plugins/builtin/cloud/plugin.tsx +7 -1
- package/src/plugins/builtin/cloud-tweets/table.tsx +57 -10
- package/src/plugins/builtin/composite-plugins.ts +39 -5
- package/src/plugins/builtin/congress-trades/detail.tsx +2 -4
- package/src/plugins/builtin/congress-trades/footer.ts +7 -16
- package/src/plugins/builtin/congress-trades/pane.tsx +12 -20
- package/src/plugins/builtin/connections/index.ts +53 -0
- package/src/plugins/builtin/connections/pane.test.tsx +79 -0
- package/src/plugins/builtin/connections/pane.tsx +258 -0
- package/src/plugins/builtin/correlation/index.test.tsx +2 -1
- package/src/plugins/builtin/correlation/index.tsx +58 -19
- package/src/plugins/builtin/correlation/matrix/model.ts +18 -7
- package/src/plugins/builtin/correlation/relationship/pane.tsx +43 -19
- package/src/plugins/builtin/correlation/settings.ts +1 -1
- package/src/plugins/builtin/credit-conditions/client.test.ts +80 -0
- package/src/plugins/builtin/credit-conditions/client.ts +105 -0
- package/src/plugins/builtin/credit-conditions/index.test.tsx +111 -0
- package/src/plugins/builtin/credit-conditions/index.tsx +227 -0
- package/src/plugins/builtin/credit-conditions/model.test.ts +43 -0
- package/src/plugins/builtin/credit-conditions/model.ts +64 -0
- package/src/plugins/builtin/debug/index.tsx +11 -6
- package/src/plugins/builtin/dividend-yield/client.test.ts +58 -0
- package/src/plugins/builtin/dividend-yield/client.ts +252 -0
- package/src/plugins/builtin/dividend-yield/index.tsx +61 -0
- package/src/plugins/builtin/dividend-yield/model.ts +83 -0
- package/src/plugins/builtin/dividend-yield/pane.tsx +305 -0
- package/src/plugins/builtin/dividend-yield/types.ts +22 -0
- package/src/plugins/builtin/earnings/data/cache.test.ts +10 -7
- package/src/plugins/builtin/earnings/data/cache.ts +23 -9
- package/src/plugins/builtin/earnings/index.tsx +57 -6
- package/src/plugins/builtin/econ/calendar-model.test.ts +37 -3
- package/src/plugins/builtin/econ/calendar-model.ts +32 -26
- package/src/plugins/builtin/econ/fred-cache.test.ts +8 -1
- package/src/plugins/builtin/econ/fred-series-map.ts +18 -0
- package/src/plugins/builtin/econ/index.test.tsx +105 -0
- package/src/plugins/builtin/econ/index.tsx +95 -52
- package/src/plugins/builtin/fear-greed/cache.test.ts +18 -3
- package/src/plugins/builtin/fear-greed/cache.ts +18 -6
- package/src/plugins/builtin/fear-greed/charts.tsx +9 -2
- package/src/plugins/builtin/fear-greed/format.ts +0 -9
- package/src/plugins/builtin/fear-greed/pane.tsx +21 -21
- package/src/plugins/builtin/futures/contracts.ts +100 -0
- package/src/plugins/builtin/futures/index.tsx +298 -0
- package/src/plugins/builtin/futures/model.test.ts +129 -0
- package/src/plugins/builtin/futures/model.ts +136 -0
- package/src/plugins/builtin/futures/pane.test.tsx +239 -0
- package/src/plugins/builtin/futures/table.test.ts +155 -0
- package/src/plugins/builtin/futures/table.tsx +241 -0
- package/src/plugins/builtin/fx-matrix/index.tsx +160 -134
- package/src/plugins/builtin/fx-matrix/pairs.ts +12 -1
- package/src/plugins/builtin/fx-matrix/pane.test.tsx +109 -0
- package/src/plugins/builtin/help/components.tsx +1 -30
- package/src/plugins/builtin/help/index.tsx +5 -25
- package/src/plugins/builtin/holders/pane.tsx +17 -12
- package/src/plugins/builtin/holders/treemap.tsx +4 -2
- package/src/plugins/builtin/insider/index.tsx +20 -10
- package/src/plugins/builtin/ipo-calendar/cache.ts +101 -0
- package/src/plugins/builtin/ipo-calendar/client.test.ts +31 -0
- package/src/plugins/builtin/ipo-calendar/client.ts +296 -0
- package/src/plugins/builtin/ipo-calendar/index.tsx +65 -0
- package/src/plugins/builtin/ipo-calendar/model.ts +145 -0
- package/src/plugins/builtin/ipo-calendar/pane.tsx +328 -0
- package/src/plugins/builtin/ipo-calendar/types.ts +19 -0
- package/src/plugins/builtin/kelly-sizer/index.test.tsx +3 -3
- package/src/plugins/builtin/kelly-sizer/model.ts +8 -1
- package/src/plugins/builtin/kelly-sizer/pane.tsx +33 -15
- package/src/plugins/builtin/kelly-sizer/view.tsx +12 -5
- package/src/plugins/builtin/market-halts/client.ts +114 -0
- package/src/plugins/builtin/market-halts/index.tsx +29 -0
- package/src/plugins/builtin/market-halts/model.test.ts +187 -0
- package/src/plugins/builtin/market-halts/model.ts +291 -0
- package/src/plugins/builtin/market-halts/pane.tsx +256 -0
- package/src/plugins/builtin/market-heatmap/data.test.ts +1 -0
- package/src/plugins/builtin/market-heatmap/data.ts +12 -3
- package/src/plugins/builtin/market-heatmap/index.tsx +131 -46
- package/src/plugins/builtin/market-movers/index.tsx +145 -63
- package/src/plugins/builtin/market-movers/model.ts +19 -3
- package/src/plugins/builtin/market-movers/screener.test.ts +108 -0
- package/src/plugins/builtin/market-movers/screener.ts +168 -10
- package/src/plugins/builtin/news/index.tsx +78 -99
- package/src/plugins/builtin/news/wire/article-search.test.ts +72 -0
- package/src/plugins/builtin/news/wire/article-search.ts +140 -0
- package/src/plugins/builtin/news/wire/breaking/pane.tsx +18 -8
- package/src/plugins/builtin/news/wire/categories.ts +35 -0
- package/src/plugins/builtin/news/wire/default-feeds.ts +47 -1
- package/src/plugins/builtin/news/wire/feed-config.test.ts +10 -5
- package/src/plugins/builtin/news/wire/index.tsx +41 -4
- package/src/plugins/builtin/news/wire/industry-pane.tsx +38 -19
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +10 -5
- package/src/plugins/builtin/news/wire/news/footer.ts +1 -0
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +15 -6
- package/src/plugins/builtin/news/wire/news/query-presets.ts +16 -2
- package/src/plugins/builtin/news/wire/news/table.test.tsx +54 -0
- package/src/plugins/builtin/news/wire/news/table.tsx +111 -17
- package/src/plugins/builtin/notes/files.test.ts +18 -0
- package/src/plugins/builtin/notes/files.ts +10 -4
- package/src/plugins/builtin/notes/index.tsx +4 -1
- package/src/plugins/builtin/notes/quick-notes-pane.test.tsx +182 -0
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +74 -31
- package/src/plugins/builtin/notes/ticker-notes-tab.test.tsx +380 -0
- package/src/plugins/builtin/notes/ticker-notes-tab.tsx +97 -40
- package/src/plugins/builtin/options/calc-seed.test.ts +118 -0
- package/src/plugins/builtin/options/calc-seed.ts +52 -0
- package/src/plugins/builtin/options/footer.ts +4 -1
- package/src/plugins/builtin/options/index.tsx +22 -1
- package/src/plugins/builtin/options/live-quotes.ts +8 -0
- package/src/plugins/builtin/options/table.ts +3 -1
- package/src/plugins/builtin/options/view.test.tsx +5 -1
- package/src/plugins/builtin/options/view.tsx +112 -17
- package/src/plugins/builtin/options-calculator/index.tsx +35 -0
- package/src/plugins/builtin/options-calculator/model.test.ts +172 -0
- package/src/plugins/builtin/options-calculator/model.ts +273 -0
- package/src/plugins/builtin/options-calculator/pane.test.tsx +138 -0
- package/src/plugins/builtin/options-calculator/pane.tsx +218 -0
- package/src/plugins/builtin/plugin-module.test.ts +16 -2
- package/src/plugins/builtin/plugin-module.ts +5 -1
- package/src/plugins/builtin/polls/client.ts +57 -0
- package/src/plugins/builtin/polls/hooks.ts +20 -0
- package/src/plugins/builtin/polls/index.tsx +35 -0
- package/src/plugins/builtin/polls/normalize.test.ts +230 -0
- package/src/plugins/builtin/polls/normalize.ts +319 -0
- package/src/plugins/builtin/polls/pane.tsx +722 -0
- package/src/plugins/builtin/polls/types.ts +77 -0
- package/src/plugins/builtin/portfolio-list/header.tsx +15 -4
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +7 -3
- package/src/plugins/builtin/portfolio-list/pane/supplemental.ts +1 -1
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -0
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +2 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +40 -67
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +25 -19
- package/src/plugins/builtin/research/index.test.ts +6 -25
- package/src/plugins/builtin/research/index.tsx +11 -5
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +86 -26
- package/src/plugins/builtin/scanner/denied.tsx +31 -0
- package/src/plugins/builtin/scanner/feed.ts +94 -0
- package/src/plugins/builtin/scanner/flow-model.test.ts +85 -0
- package/src/plugins/builtin/scanner/flow-model.ts +133 -0
- package/src/plugins/builtin/scanner/flow-pane.tsx +197 -0
- package/src/plugins/builtin/scanner/hilo-bars.tsx +121 -0
- package/src/plugins/builtin/scanner/hilo-model.test.ts +44 -0
- package/src/plugins/builtin/scanner/hilo-model.ts +75 -0
- package/src/plugins/builtin/scanner/hilo-pane.tsx +165 -0
- package/src/plugins/builtin/scanner/index.ts +109 -0
- package/src/plugins/builtin/scanner/waiting.tsx +11 -0
- package/src/plugins/builtin/sec/index.tsx +11 -7
- package/src/plugins/builtin/sectors/index.tsx +105 -81
- package/src/plugins/builtin/sectors/move-bar.tsx +43 -0
- package/src/plugins/builtin/sectors/sector-data.ts +18 -0
- package/src/plugins/builtin/sectors/sector-model.ts +13 -15
- package/src/plugins/builtin/shared/auto-refresh.ts +51 -0
- package/src/plugins/builtin/shared/cloud-upgrade.ts +29 -5
- package/src/plugins/builtin/shared/pane-footer.ts +16 -3
- package/src/plugins/builtin/shared/screener-live-quotes.test.ts +91 -0
- package/src/plugins/builtin/shared/screener-live-quotes.ts +134 -0
- package/src/plugins/builtin/shared/table-pane.ts +1 -5
- package/src/plugins/builtin/shared/use-quote-board.test.tsx +211 -0
- package/src/plugins/builtin/shared/use-quote-board.ts +195 -0
- package/src/plugins/builtin/short-interest/client.ts +124 -0
- package/src/plugins/builtin/short-interest/index.tsx +62 -0
- package/src/plugins/builtin/short-interest/model.ts +113 -0
- package/src/plugins/builtin/short-interest/pane.tsx +252 -0
- package/src/plugins/builtin/short-interest/types.ts +9 -0
- package/src/plugins/builtin/substack/article-detail.tsx +15 -1
- package/src/plugins/builtin/substack/pane-footer.ts +3 -22
- package/src/plugins/builtin/substack/pane.tsx +1 -2
- package/src/plugins/builtin/thirteenf/api.ts +4 -1
- package/src/plugins/builtin/thirteenf/model.ts +2 -0
- package/src/plugins/builtin/thirteenf/pane.tsx +6 -2
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +10 -4
- package/src/plugins/builtin/ticker-detail/data-panes/provider-search.tsx +67 -11
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +15 -8
- package/src/plugins/builtin/ticker-detail/index.tsx +5 -21
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +72 -32
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +0 -10
- package/src/plugins/builtin/ticker-detail/pane.tsx +4 -1
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.test.tsx +70 -0
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +34 -26
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +96 -49
- package/src/plugins/builtin/ticker-detail/research-tabs.ts +32 -0
- package/src/plugins/builtin/ticker-research-backend-plugin.ts +2 -9
- package/src/plugins/builtin/ticker-research-plugin.ts +6 -0
- package/src/plugins/builtin/treasury-auctions/cache.test.ts +173 -0
- package/src/plugins/builtin/treasury-auctions/cache.ts +104 -0
- package/src/plugins/builtin/treasury-auctions/client.test.ts +181 -0
- package/src/plugins/builtin/treasury-auctions/client.ts +151 -0
- package/src/plugins/builtin/treasury-auctions/index.tsx +90 -0
- package/src/plugins/builtin/treasury-auctions/model.test.ts +147 -0
- package/src/plugins/builtin/treasury-auctions/model.ts +188 -0
- package/src/plugins/builtin/treasury-auctions/pane.test.tsx +170 -0
- package/src/plugins/builtin/treasury-auctions/pane.tsx +417 -0
- package/src/plugins/builtin/treasury-auctions/types.ts +59 -0
- package/src/plugins/builtin/tv/pane.tsx +67 -7
- package/src/plugins/builtin/tv/youtube-embed.test.ts +84 -0
- package/src/plugins/builtin/tv/youtube-embed.ts +173 -0
- package/src/plugins/builtin/tv/youtube-stream.ts +27 -2
- package/src/plugins/builtin/volatility/client.ts +87 -0
- package/src/plugins/builtin/volatility/index.test.tsx +107 -0
- package/src/plugins/builtin/volatility/index.tsx +193 -0
- package/src/plugins/builtin/volatility/model.test.ts +66 -0
- package/src/plugins/builtin/volatility/model.ts +113 -0
- package/src/plugins/builtin/world-indices/footer.ts +43 -23
- package/src/plugins/builtin/world-indices/index.tsx +44 -93
- package/src/plugins/builtin/world-indices/indices.ts +11 -2
- package/src/plugins/builtin/world-indices/model.ts +17 -24
- package/src/plugins/builtin/world-indices/pane.test.tsx +116 -0
- package/src/plugins/builtin/world-indices/table.tsx +82 -37
- package/src/plugins/builtin/yield-curve/index.tsx +16 -7
- package/src/plugins/builtin/yield-curve/treasury-data.test.ts +25 -0
- package/src/plugins/builtin/yield-curve/treasury-data.ts +16 -0
- package/src/plugins/catalog-backend.ts +8 -0
- package/src/plugins/catalog-ui.ts +8 -0
- package/src/plugins/event-bus.ts +1 -0
- package/src/plugins/ibkr/gateway/account-loaders.ts +1 -1
- package/src/plugins/ibkr/trade/tab/footer.ts +9 -23
- package/src/plugins/ibkr/trade/tab/index.tsx +1 -5
- package/src/plugins/ibkr/trading/pane-view.tsx +149 -87
- package/src/plugins/ibkr/trading/pane.tsx +2 -2
- package/src/plugins/ownership.ts +3 -0
- package/src/plugins/pane-manager/floating.ts +8 -2
- package/src/plugins/pane-manager.test.ts +13 -0
- package/src/plugins/prediction-markets/backend-plugin.ts +2 -0
- package/src/plugins/prediction-markets/capability.test.ts +281 -0
- package/src/plugins/prediction-markets/capability.ts +171 -0
- package/src/plugins/prediction-markets/chart.tsx +18 -26
- package/src/plugins/prediction-markets/columns.ts +3 -2
- package/src/plugins/prediction-markets/controller/catalog.ts +15 -12
- package/src/plugins/prediction-markets/controller/detail.ts +4 -0
- package/src/plugins/prediction-markets/controller/index.ts +0 -15
- package/src/plugins/prediction-markets/detail/book.tsx +3 -23
- package/src/plugins/prediction-markets/detail/overview.tsx +0 -18
- package/src/plugins/prediction-markets/detail/pane.tsx +36 -12
- package/src/plugins/prediction-markets/detail.test.tsx +1 -1
- package/src/plugins/prediction-markets/index.tsx +2 -0
- package/src/plugins/prediction-markets/metrics.ts +28 -18
- package/src/plugins/prediction-markets/navigation.ts +1 -0
- package/src/plugins/prediction-markets/pane.test.tsx +1 -1
- package/src/plugins/prediction-markets/pane.tsx +0 -1
- package/src/plugins/prediction-markets/services/fetch.ts +3 -2
- package/src/plugins/prediction-markets/services/kalshi/adapter.ts +82 -23
- package/src/plugins/prediction-markets/services/kalshi/normalize.ts +3 -1
- package/src/plugins/prediction-markets/services/kalshi/types.ts +14 -0
- package/src/plugins/prediction-markets/services/polymarket/adapter.ts +26 -14
- package/src/plugins/prediction-markets/services/polymarket/detail.ts +67 -18
- package/src/plugins/prediction-markets/test-helpers.tsx +0 -1
- package/src/plugins/prediction-markets/types.ts +3 -9
- package/src/plugins/registry/context.ts +6 -1
- package/src/plugins/registry/index.test.ts +2 -0
- package/src/plugins/registry/index.ts +53 -3
- package/src/plugins/runtime/context.tsx +4 -2
- package/src/plugins/runtime/index.tsx +9 -0
- package/src/remote/controller.test.ts +17 -4
- package/src/renderers/electrobun/bun/application-menu/index.ts +1 -1
- package/src/renderers/electrobun/bun/core-capabilities.ts +2 -2
- package/src/renderers/electrobun/bun/desktop/capability-bridge.test.ts +64 -0
- package/src/renderers/electrobun/bun/desktop/capability-bridge.ts +41 -7
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +5 -2
- package/src/renderers/electrobun/bun/desktop/http-fetch.test.ts +33 -0
- package/src/renderers/electrobun/bun/desktop/http-fetch.ts +53 -6
- package/src/renderers/electrobun/bun/desktop/initialization.test.ts +27 -0
- package/src/renderers/electrobun/bun/desktop/initialization.ts +6 -1
- package/src/renderers/electrobun/bun/index.ts +1 -0
- package/src/renderers/electrobun/shared/protocol.ts +2 -0
- package/src/renderers/electrobun/view/app-services.ts +25 -2
- package/src/renderers/electrobun/view/build-assets.ts +5 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +186 -65
- package/src/renderers/electrobun/view/cli-pane-shot-health.test.ts +25 -0
- package/src/renderers/electrobun/view/cli-pane-shot-health.ts +31 -0
- package/src/renderers/electrobun/view/data-table/index.tsx +10 -11
- package/src/renderers/electrobun/view/data-table/row.tsx +2 -0
- package/src/renderers/electrobun/view/desktop/controls.test.tsx +68 -0
- package/src/renderers/electrobun/view/desktop/controls.tsx +25 -1
- package/src/renderers/electrobun/view/host/box.test.tsx +80 -0
- package/src/renderers/electrobun/view/host/media-surface.tsx +70 -3
- package/src/renderers/electrobun/view/host/tabs.tsx +97 -5
- package/src/renderers/electrobun/view/host/text.tsx +5 -2
- package/src/renderers/electrobun/view/input-host.test.tsx +140 -0
- package/src/renderers/electrobun/view/input-host.tsx +4 -2
- package/src/renderers/electrobun/view/native-stubs/backend-rpc.ts +19 -1
- package/src/renderers/electrobun/view/native-stubs/broker-sync-native-loader.ts +7 -0
- package/src/renderers/electrobun/view/native-stubs/chart/kitty-support.ts +10 -0
- package/src/renderers/electrobun/view/remote/capability-invoker.test.ts +46 -0
- package/src/renderers/electrobun/view/remote/capability-invoker.ts +34 -13
- package/src/renderers/electrobun/view/remote/connection-health-backend.ts +19 -0
- package/src/renderers/electrobun/view/remote/connection-health.test.ts +44 -0
- package/src/renderers/electrobun/view/remote/connection-health.ts +49 -0
- package/src/renderers/electrobun/view/styles.css +5 -0
- package/src/renderers/opentui/dialog-host.tsx +279 -80
- package/src/renderers/opentui/host.tsx +15 -1
- package/src/renderers/opentui/terminal-media.test.ts +102 -0
- package/src/renderers/opentui/terminal-media.ts +142 -0
- package/src/renderers/opentui/test-utils.tsx +9 -6
- package/src/renderers/opentui/toast-host.tsx +136 -7
- package/src/renderers/opentui/ui-host.tsx +19 -3
- package/src/sources/provider-router/connection-health.test.ts +28 -0
- package/src/sources/provider-router/connection-health.ts +47 -0
- package/src/sources/provider-router/history.test.ts +53 -4
- package/src/sources/provider-router/history.ts +119 -14
- package/src/sources/provider-router/index.ts +12 -1
- package/src/sources/yahoo-finance/history.ts +2 -9
- package/src/sources/yahoo-finance/http.ts +1 -1
- package/src/sources/yahoo-finance/symbols.ts +1 -1
- package/src/sources/yahoo-finance/types.ts +19 -0
- package/src/state/app/context/index.test.tsx +101 -0
- package/src/state/app/context/index.tsx +10 -0
- package/src/state/config-save-scheduler.ts +1 -6
- package/src/state/persist-scheduler.test.ts +31 -0
- package/src/state/persist-scheduler.ts +21 -8
- package/src/sync/auth-transition.test.ts +36 -0
- package/src/sync/auth-transition.ts +22 -0
- package/src/sync/core-contributors.test.ts +58 -1
- package/src/sync/core-contributors.ts +39 -2
- package/src/sync/react.ts +9 -0
- package/src/test-support/plugin-runtime.ts +3 -0
- package/src/theme/font-scale.test.ts +14 -0
- package/src/theme/font-scale.ts +69 -0
- package/src/tickers/search/index.test.ts +284 -2
- package/src/tickers/search/index.ts +55 -18
- package/src/tickers/search/ranking.ts +143 -18
- package/src/tickers/search/types.ts +1 -0
- package/src/time-series/alignment.ts +15 -11
- package/src/time-series/field-catalog.ts +10 -0
- package/src/time-series/fundamentals.ts +19 -11
- package/src/time-series/hooks.ts +8 -2
- package/src/time-series/parsed-history-cache.ts +35 -0
- package/src/time-series/resolution.ts +10 -0
- package/src/time-series/resolve.test.ts +332 -3
- package/src/time-series/resolve.ts +225 -25
- package/src/time-series/spec-studies.test.ts +23 -0
- package/src/time-series/spec.ts +21 -2
- package/src/time-series/transforms.test.ts +76 -1
- package/src/time-series/transforms.ts +39 -8
- package/src/time-series/types.ts +9 -2
- package/src/time-series/use-chart-resolution.test.tsx +105 -1
- package/src/time-series/use-chart-resolution.ts +67 -13
- package/src/types/config.ts +30 -27
- package/src/types/media.ts +2 -0
- package/src/types/plugin.ts +8 -1
- package/src/ui/host.tsx +4 -0
- package/src/ui/pointer-drag.ts +12 -0
- package/src/ui/qr.test.ts +79 -0
- package/src/ui/qr.ts +82 -0
- package/src/updater/github-releases.test.ts +3 -3
- package/src/updater/github-releases.ts +1 -1
- package/src/updater.test.ts +117 -16
- package/src/updater.ts +32 -5
- package/src/utils/exchanges.ts +1 -0
- package/src/utils/external-url.test.ts +32 -0
- package/src/utils/external-url.ts +23 -0
- package/src/utils/sort-values.ts +31 -0
- package/src/utils/zoned-date-time.ts +67 -0
- package/src/components/onboarding/wizard-keyboard.ts +0 -306
- package/src/plugins/builtin/chart-composer/date-window-dialog.tsx +0 -120
|
@@ -1,21 +1,184 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
buildTickerSearchCandidates,
|
|
4
|
+
searchTickerCandidates,
|
|
5
|
+
} from "../../../tickers/search";
|
|
3
6
|
import { useOptionalAppSelector } from "../../../state/app/context";
|
|
4
7
|
import type { TickerRecord } from "../../../types/ticker";
|
|
8
|
+
import { searchChartSeriesCapabilities } from "../../../capabilities";
|
|
5
9
|
import { getSharedRegistry } from "../../registry";
|
|
6
10
|
import {
|
|
7
11
|
analyzeSeriesSearchQuery,
|
|
12
|
+
buildCapabilitySeriesSuggestions,
|
|
8
13
|
buildSeriesCatalogSuggestions,
|
|
9
14
|
type SeriesCatalogInstrument,
|
|
10
15
|
type SeriesCatalogSuggestion,
|
|
11
16
|
} from "./series-catalog";
|
|
12
17
|
|
|
13
18
|
const EMPTY_TICKERS: ReadonlyMap<string, TickerRecord> = new Map();
|
|
19
|
+
const EMPTY_RECENT: readonly string[] = [];
|
|
20
|
+
const DEFAULT_CATALOG_INSTRUMENTS: readonly SeriesCatalogInstrument[] = [
|
|
21
|
+
{ symbol: "AAPL", exchange: "NASDAQ", name: "Apple Inc." },
|
|
22
|
+
{ symbol: "MSFT", exchange: "NASDAQ", name: "Microsoft Corporation" },
|
|
23
|
+
{ symbol: "GOOGL", exchange: "NASDAQ", name: "Alphabet Inc." },
|
|
24
|
+
{ symbol: "AMZN", exchange: "NASDAQ", name: "Amazon.com Inc." },
|
|
25
|
+
{ symbol: "NVDA", exchange: "NASDAQ", name: "NVIDIA Corporation" },
|
|
26
|
+
{ symbol: "TSLA", exchange: "NASDAQ", name: "Tesla Inc." },
|
|
27
|
+
{ symbol: "META", exchange: "NASDAQ", name: "Meta Platforms Inc." },
|
|
28
|
+
{ symbol: "BRK.B", exchange: "NYSE", name: "Berkshire Hathaway Inc." },
|
|
29
|
+
{ symbol: "JPM", exchange: "NYSE", name: "JPMorgan Chase & Co." },
|
|
30
|
+
{ symbol: "V", exchange: "NYSE", name: "Visa Inc." },
|
|
31
|
+
{ symbol: "BTC-USD", exchange: "CCC", name: "Bitcoin USD" },
|
|
32
|
+
{ symbol: "ETH-USD", exchange: "CCC", name: "Ethereum USD" },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
function instrumentFromTicker(ticker: TickerRecord): SeriesCatalogInstrument {
|
|
36
|
+
return {
|
|
37
|
+
symbol: ticker.metadata.ticker,
|
|
38
|
+
...(ticker.metadata.exchange ? { exchange: ticker.metadata.exchange } : {}),
|
|
39
|
+
...(ticker.metadata.name ? { name: ticker.metadata.name } : {}),
|
|
40
|
+
...(ticker.metadata.assetCategory ? { assetCategory: ticker.metadata.assetCategory } : {}),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function uniqueCatalogInstruments(
|
|
45
|
+
instruments: readonly SeriesCatalogInstrument[],
|
|
46
|
+
): SeriesCatalogInstrument[] {
|
|
47
|
+
const seen = new Set<string>();
|
|
48
|
+
return instruments.filter((instrument) => {
|
|
49
|
+
const key = `${instrument.symbol}:${instrument.exchange ?? ""}:${instrument.assetCategory ?? ""}`;
|
|
50
|
+
if (seen.has(key)) return false;
|
|
51
|
+
seen.add(key);
|
|
52
|
+
return true;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function candidateToInstrument(candidate: {
|
|
57
|
+
symbol: string;
|
|
58
|
+
ticker?: TickerRecord;
|
|
59
|
+
result?: { primaryExchange?: string; exchange?: string; name?: string; type?: string };
|
|
60
|
+
}): SeriesCatalogInstrument {
|
|
61
|
+
const exchange = candidate.ticker?.metadata.exchange
|
|
62
|
+
|| candidate.result?.primaryExchange
|
|
63
|
+
|| candidate.result?.exchange;
|
|
64
|
+
const name = candidate.ticker?.metadata.name || candidate.result?.name;
|
|
65
|
+
const assetCategory = candidate.ticker?.metadata.assetCategory || candidate.result?.type;
|
|
66
|
+
return {
|
|
67
|
+
symbol: candidate.symbol,
|
|
68
|
+
...(exchange ? { exchange } : {}),
|
|
69
|
+
...(name ? { name } : {}),
|
|
70
|
+
...(assetCategory ? { assetCategory } : {}),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function useCatalogUniverse(query: string): {
|
|
75
|
+
instruments: SeriesCatalogInstrument[];
|
|
76
|
+
loading: boolean;
|
|
77
|
+
} {
|
|
78
|
+
const tickers = useOptionalAppSelector((state) => state.tickers, EMPTY_TICKERS);
|
|
79
|
+
const recentSymbols = useOptionalAppSelector((state) => state.recentTickers, EMPTY_RECENT);
|
|
80
|
+
const watchlist = useMemo(
|
|
81
|
+
() => [...tickers.values()].map(instrumentFromTicker),
|
|
82
|
+
[tickers],
|
|
83
|
+
);
|
|
84
|
+
const recents = useMemo(
|
|
85
|
+
() => recentSymbols.flatMap((symbol) => {
|
|
86
|
+
const ticker = tickers.get(symbol);
|
|
87
|
+
if (ticker) return [instrumentFromTicker(ticker)];
|
|
88
|
+
const trimmed = symbol.trim();
|
|
89
|
+
return trimmed ? [{ symbol: trimmed }] : [];
|
|
90
|
+
}),
|
|
91
|
+
[recentSymbols, tickers],
|
|
92
|
+
);
|
|
93
|
+
const [search, setSearch] = useState<{
|
|
94
|
+
query: string;
|
|
95
|
+
instruments: SeriesCatalogInstrument[];
|
|
96
|
+
loading: boolean;
|
|
97
|
+
}>({ query: "", instruments: [], loading: false });
|
|
98
|
+
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
const instrumentQuery = query.trim();
|
|
101
|
+
if (!instrumentQuery || instrumentQuery.includes(":")) {
|
|
102
|
+
setSearch((current) => (
|
|
103
|
+
current.query === "" && current.instruments.length === 0 && !current.loading
|
|
104
|
+
? current
|
|
105
|
+
: { query: "", instruments: [], loading: false }
|
|
106
|
+
));
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const applyLocal = () => {
|
|
111
|
+
const candidates = buildTickerSearchCandidates({
|
|
112
|
+
query: instrumentQuery,
|
|
113
|
+
tickers,
|
|
114
|
+
providerResults: [],
|
|
115
|
+
totalLimit: 12,
|
|
116
|
+
localLimit: 8,
|
|
117
|
+
includeOptionContracts: true,
|
|
118
|
+
});
|
|
119
|
+
setSearch({
|
|
120
|
+
query: instrumentQuery,
|
|
121
|
+
instruments: candidates.map(candidateToInstrument),
|
|
122
|
+
loading: false,
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const registry = getSharedRegistry();
|
|
127
|
+
if (!registry) {
|
|
128
|
+
applyLocal();
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
let cancelled = false;
|
|
133
|
+
setSearch({ query: instrumentQuery, instruments: [], loading: true });
|
|
134
|
+
const timer = setTimeout(() => {
|
|
135
|
+
void searchTickerCandidates({
|
|
136
|
+
query: instrumentQuery,
|
|
137
|
+
tickers,
|
|
138
|
+
dataProvider: registry.marketData,
|
|
139
|
+
totalLimit: 12,
|
|
140
|
+
localLimit: 8,
|
|
141
|
+
includeOptionContracts: true,
|
|
142
|
+
}).then((candidates) => {
|
|
143
|
+
if (cancelled) return;
|
|
144
|
+
setSearch({
|
|
145
|
+
query: instrumentQuery,
|
|
146
|
+
instruments: candidates.map(candidateToInstrument),
|
|
147
|
+
loading: false,
|
|
148
|
+
});
|
|
149
|
+
}).catch(() => {
|
|
150
|
+
if (!cancelled) applyLocal();
|
|
151
|
+
});
|
|
152
|
+
}, 80);
|
|
153
|
+
|
|
154
|
+
return () => {
|
|
155
|
+
cancelled = true;
|
|
156
|
+
clearTimeout(timer);
|
|
157
|
+
};
|
|
158
|
+
}, [query, tickers]);
|
|
159
|
+
|
|
160
|
+
const searched = search.query === query.trim() ? search.instruments : [];
|
|
161
|
+
const instruments = useMemo(() => {
|
|
162
|
+
const merged = uniqueCatalogInstruments([...watchlist, ...recents, ...searched]);
|
|
163
|
+
return merged.length > 0 ? merged : [...DEFAULT_CATALOG_INSTRUMENTS];
|
|
164
|
+
}, [recents, searched, watchlist]);
|
|
165
|
+
|
|
166
|
+
return {
|
|
167
|
+
instruments,
|
|
168
|
+
loading: search.loading && search.query === query.trim(),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
14
171
|
|
|
15
172
|
export interface SeriesCatalogSearchResult {
|
|
16
173
|
suggestions: SeriesCatalogSuggestion[];
|
|
17
174
|
instruments: SeriesCatalogInstrument[];
|
|
18
175
|
loading: boolean;
|
|
176
|
+
/** Set when a lookup failed, so an outage is never reported as zero matches. */
|
|
177
|
+
error: string | null;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function searchFailureMessage(error: unknown): string {
|
|
181
|
+
return error instanceof Error && error.message.trim() ? error.message : "Series search failed.";
|
|
19
182
|
}
|
|
20
183
|
|
|
21
184
|
/** Shared smart-series search used by both inline quick-add and the full editor. */
|
|
@@ -30,27 +193,69 @@ export function useSeriesCatalogSuggestions({
|
|
|
30
193
|
}): SeriesCatalogSearchResult {
|
|
31
194
|
const tickers = useOptionalAppSelector((state) => state.tickers, EMPTY_TICKERS);
|
|
32
195
|
const analysis = useMemo(() => analyzeSeriesSearchQuery(query), [query]);
|
|
196
|
+
const [providerSearch, setProviderSearch] = useState<{
|
|
197
|
+
query: string;
|
|
198
|
+
suggestions: SeriesCatalogSuggestion[];
|
|
199
|
+
loading: boolean;
|
|
200
|
+
error: string | null;
|
|
201
|
+
}>({ query: "", suggestions: [], loading: false, error: null });
|
|
33
202
|
const [search, setSearch] = useState<{
|
|
34
203
|
query: string;
|
|
35
204
|
instruments: SeriesCatalogInstrument[];
|
|
36
205
|
loading: boolean;
|
|
37
|
-
|
|
206
|
+
error: string | null;
|
|
207
|
+
}>({ query: "", instruments: [], loading: false, error: null });
|
|
208
|
+
|
|
209
|
+
useEffect(() => {
|
|
210
|
+
const normalizedQuery = query.trim();
|
|
211
|
+
const registry = getSharedRegistry();
|
|
212
|
+
if (!enabled || !normalizedQuery || !registry) {
|
|
213
|
+
setProviderSearch({ query: "", suggestions: [], loading: false, error: null });
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
let cancelled = false;
|
|
217
|
+
const controller = new AbortController();
|
|
218
|
+
setProviderSearch({ query: normalizedQuery, suggestions: [], loading: true, error: null });
|
|
219
|
+
const timer = setTimeout(() => {
|
|
220
|
+
void searchChartSeriesCapabilities(registry, normalizedQuery, 8, controller.signal).then((items) => {
|
|
221
|
+
if (!cancelled) setProviderSearch({
|
|
222
|
+
query: normalizedQuery,
|
|
223
|
+
suggestions: buildCapabilitySeriesSuggestions(items),
|
|
224
|
+
loading: false,
|
|
225
|
+
error: null,
|
|
226
|
+
});
|
|
227
|
+
}).catch((error: unknown) => {
|
|
228
|
+
if (controller.signal.aborted || cancelled) return;
|
|
229
|
+
setProviderSearch({
|
|
230
|
+
query: normalizedQuery,
|
|
231
|
+
suggestions: [],
|
|
232
|
+
loading: false,
|
|
233
|
+
error: searchFailureMessage(error),
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
}, 250);
|
|
237
|
+
return () => {
|
|
238
|
+
cancelled = true;
|
|
239
|
+
controller.abort();
|
|
240
|
+
clearTimeout(timer);
|
|
241
|
+
};
|
|
242
|
+
}, [enabled, query]);
|
|
38
243
|
|
|
39
244
|
useEffect(() => {
|
|
40
245
|
const instrumentQuery = analysis.instrumentQuery.trim();
|
|
41
246
|
if (!enabled || !instrumentQuery || analysis.directInstrument) {
|
|
42
|
-
setSearch({ query: "", instruments: [], loading: false });
|
|
247
|
+
setSearch({ query: "", instruments: [], loading: false, error: null });
|
|
43
248
|
return;
|
|
44
249
|
}
|
|
45
250
|
|
|
46
251
|
const registry = getSharedRegistry();
|
|
47
252
|
if (!registry) {
|
|
48
|
-
setSearch({ query: instrumentQuery, instruments: [], loading: false });
|
|
253
|
+
setSearch({ query: instrumentQuery, instruments: [], loading: false, error: null });
|
|
49
254
|
return;
|
|
50
255
|
}
|
|
51
256
|
|
|
52
257
|
let cancelled = false;
|
|
53
|
-
setSearch({ query: instrumentQuery, instruments: [], loading: true });
|
|
258
|
+
setSearch({ query: instrumentQuery, instruments: [], loading: true, error: null });
|
|
54
259
|
const timer = setTimeout(() => {
|
|
55
260
|
void searchTickerCandidates({
|
|
56
261
|
query: instrumentQuery,
|
|
@@ -63,21 +268,19 @@ export function useSeriesCatalogSuggestions({
|
|
|
63
268
|
if (cancelled) return;
|
|
64
269
|
setSearch({
|
|
65
270
|
query: instrumentQuery,
|
|
66
|
-
instruments: candidates.map(
|
|
67
|
-
symbol: candidate.symbol,
|
|
68
|
-
...(candidate.ticker?.metadata.exchange
|
|
69
|
-
? { exchange: candidate.ticker.metadata.exchange }
|
|
70
|
-
: candidate.result?.primaryExchange || candidate.result?.exchange
|
|
71
|
-
? { exchange: candidate.result?.primaryExchange || candidate.result?.exchange }
|
|
72
|
-
: {}),
|
|
73
|
-
...(candidate.ticker?.metadata.name || candidate.result?.name
|
|
74
|
-
? { name: candidate.ticker?.metadata.name || candidate.result?.name }
|
|
75
|
-
: {}),
|
|
76
|
-
})),
|
|
271
|
+
instruments: candidates.map(candidateToInstrument),
|
|
77
272
|
loading: false,
|
|
273
|
+
error: null,
|
|
78
274
|
});
|
|
79
|
-
}).catch(() => {
|
|
80
|
-
if (!cancelled)
|
|
275
|
+
}).catch((error: unknown) => {
|
|
276
|
+
if (!cancelled) {
|
|
277
|
+
setSearch({
|
|
278
|
+
query: instrumentQuery,
|
|
279
|
+
instruments: [],
|
|
280
|
+
loading: false,
|
|
281
|
+
error: searchFailureMessage(error),
|
|
282
|
+
});
|
|
283
|
+
}
|
|
81
284
|
});
|
|
82
285
|
}, 80);
|
|
83
286
|
|
|
@@ -90,14 +293,18 @@ export function useSeriesCatalogSuggestions({
|
|
|
90
293
|
const instruments = search.query === analysis.instrumentQuery
|
|
91
294
|
? search.instruments
|
|
92
295
|
: [];
|
|
93
|
-
const suggestions = useMemo(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
296
|
+
const suggestions = useMemo(() => {
|
|
297
|
+
const builtIn = buildSeriesCatalogSuggestions(query, defaultInstrument, instruments);
|
|
298
|
+
const provider = providerSearch.query === query.trim() ? providerSearch.suggestions : [];
|
|
299
|
+
return [...provider, ...builtIn.filter((entry) => !provider.some((candidate) => candidate.id === entry.id))].slice(0, 8);
|
|
300
|
+
}, [defaultInstrument, instruments, providerSearch, query]);
|
|
97
301
|
|
|
98
302
|
return {
|
|
99
303
|
suggestions,
|
|
100
304
|
instruments,
|
|
101
|
-
loading: search.loading && search.query === analysis.instrumentQuery
|
|
305
|
+
loading: (search.loading && search.query === analysis.instrumentQuery)
|
|
306
|
+
|| (providerSearch.loading && providerSearch.query === query.trim()),
|
|
307
|
+
error: (search.query === analysis.instrumentQuery ? search.error : null)
|
|
308
|
+
?? (providerSearch.query === query.trim() ? providerSearch.error : null),
|
|
102
309
|
};
|
|
103
310
|
}
|
|
@@ -1255,6 +1255,28 @@ describe("ChatContent", () => {
|
|
|
1255
1255
|
expect(frame).not.toContain("Type a message...");
|
|
1256
1256
|
});
|
|
1257
1257
|
|
|
1258
|
+
test("keeps logged-out actions readable in a narrow pane", async () => {
|
|
1259
|
+
const controller = createController({
|
|
1260
|
+
sessionToken: null,
|
|
1261
|
+
user: null,
|
|
1262
|
+
messages: [makeMessage(1)],
|
|
1263
|
+
});
|
|
1264
|
+
|
|
1265
|
+
await act(async () => {
|
|
1266
|
+
testSetup = await testRender(createHarness(controller), {
|
|
1267
|
+
width: 27,
|
|
1268
|
+
height: 12,
|
|
1269
|
+
});
|
|
1270
|
+
});
|
|
1271
|
+
|
|
1272
|
+
await flushFrame();
|
|
1273
|
+
|
|
1274
|
+
const frame = setup().captureCharFrame();
|
|
1275
|
+
expect(frame).toContain("Read-only chat.");
|
|
1276
|
+
expect(frame).toContain("Log In");
|
|
1277
|
+
expect(frame).toContain("Sign Up");
|
|
1278
|
+
});
|
|
1279
|
+
|
|
1258
1280
|
test("shows a logged-in icon in the cloud status widget for cached sessions", async () => {
|
|
1259
1281
|
const controller = createController({
|
|
1260
1282
|
sessionToken: "token-123",
|
|
@@ -2,6 +2,7 @@ import { Box, Text, TextAttributes, type TextareaRenderable } from "../../../../
|
|
|
2
2
|
import { getMessageComposerBlockHeight, MessageComposer } from "../../../../components/ui";
|
|
3
3
|
import { colors } from "../../../../theme/colors";
|
|
4
4
|
import { t } from "../../../../i18n";
|
|
5
|
+
import { truncateToDisplayWidth } from "../../../../utils/format";
|
|
5
6
|
import type { ChatMessage } from "../../../../api-client";
|
|
6
7
|
import { InlineAuthActions } from "../../cloud/auth-actions";
|
|
7
8
|
import { ChatActionChip } from "../message/action-chip";
|
|
@@ -130,22 +131,23 @@ export function ChatComposerArea({
|
|
|
130
131
|
user,
|
|
131
132
|
}: ChatComposerAreaProps) {
|
|
132
133
|
if (!canSend) {
|
|
134
|
+
const fitLine = (value: string) => truncateToDisplayWidth(t(value), contentWidth);
|
|
133
135
|
return (
|
|
134
136
|
<Box width={contentWidth} height={2} flexDirection="column">
|
|
135
137
|
{!user && !hasSavedSession ? (
|
|
136
138
|
<>
|
|
137
|
-
<Text fg={colors.textDim}>{
|
|
139
|
+
<Text fg={colors.textDim}>{fitLine("Read-only chat. Log in or sign up to send.")}</Text>
|
|
138
140
|
<InlineAuthActions />
|
|
139
141
|
</>
|
|
140
142
|
) : !user ? (
|
|
141
143
|
<>
|
|
142
|
-
<Text fg={colors.positive}>{
|
|
144
|
+
<Text fg={colors.positive}>{fitLine("Saved login found. Log in again to send.")}</Text>
|
|
143
145
|
<InlineAuthActions showSignup={false} />
|
|
144
146
|
</>
|
|
145
147
|
) : (
|
|
146
148
|
<>
|
|
147
|
-
<Text fg={colors.positive}>{
|
|
148
|
-
<Text fg={colors.textDim}>{
|
|
149
|
+
<Text fg={colors.positive}>{fitLine("Verify your email to send messages.")}</Text>
|
|
150
|
+
<Text fg={colors.textDim}>{fitLine("Ctrl+P, then Resend Verification Email")}</Text>
|
|
149
151
|
</>
|
|
150
152
|
)}
|
|
151
153
|
</Box>
|
|
@@ -116,6 +116,9 @@ export function ChatContent({
|
|
|
116
116
|
const nextRows = estimateComposerHeight(draft, composerTextWidthRef.current);
|
|
117
117
|
setComposerRows((current) => (current === nextRows ? current : nextRows));
|
|
118
118
|
}, []);
|
|
119
|
+
const retryMessages = useCallback(() => {
|
|
120
|
+
void controller.refreshChannelMessages(channelId).catch(() => {});
|
|
121
|
+
}, [channelId, controller]);
|
|
119
122
|
const {
|
|
120
123
|
channels,
|
|
121
124
|
channelsLoading,
|
|
@@ -125,6 +128,7 @@ export function ChatContent({
|
|
|
125
128
|
loading,
|
|
126
129
|
loadingOlderMessages,
|
|
127
130
|
messages,
|
|
131
|
+
messagesError,
|
|
128
132
|
onlineCount,
|
|
129
133
|
replyTo,
|
|
130
134
|
setReplyTo,
|
|
@@ -133,6 +137,7 @@ export function ChatContent({
|
|
|
133
137
|
applyingExternalDraftRef,
|
|
134
138
|
channelId,
|
|
135
139
|
controller,
|
|
140
|
+
focused,
|
|
136
141
|
initialSnapshot,
|
|
137
142
|
inputRef,
|
|
138
143
|
inputValueRef,
|
|
@@ -572,6 +577,8 @@ export function ChatContent({
|
|
|
572
577
|
jumpToMessage={jumpToMessage}
|
|
573
578
|
loading={loading}
|
|
574
579
|
loadingOlderMessages={loadingOlderMessages}
|
|
580
|
+
messagesError={messagesError}
|
|
581
|
+
onRetryMessages={retryMessages}
|
|
575
582
|
messageAreaHeight={messageAreaHeight}
|
|
576
583
|
messageBodyWidth={messageBodyWidth}
|
|
577
584
|
messages={messages}
|
|
@@ -14,6 +14,7 @@ interface ChatSnapshotStateArgs {
|
|
|
14
14
|
applyingExternalDraftRef: MutableRef<boolean>;
|
|
15
15
|
channelId: string;
|
|
16
16
|
controller: ChatContentController;
|
|
17
|
+
focused: boolean;
|
|
17
18
|
initialSnapshot: ChatSnapshot;
|
|
18
19
|
inputRef: MutableRef<TextareaRenderable | null>;
|
|
19
20
|
inputValueRef: MutableRef<string>;
|
|
@@ -63,6 +64,7 @@ export function useChatSnapshotState({
|
|
|
63
64
|
applyingExternalDraftRef,
|
|
64
65
|
channelId,
|
|
65
66
|
controller,
|
|
67
|
+
focused,
|
|
66
68
|
initialSnapshot,
|
|
67
69
|
inputRef,
|
|
68
70
|
inputValueRef,
|
|
@@ -81,13 +83,16 @@ export function useChatSnapshotState({
|
|
|
81
83
|
const [hasSavedSession, setHasSavedSession] = useState(initialSnapshot.hasSavedSession);
|
|
82
84
|
const [user, setUser] = useState<{ id: string; username: string; emailVerified: boolean } | null>(initialSnapshot.user);
|
|
83
85
|
const [loading, setLoading] = useState(initialSnapshot.loading);
|
|
86
|
+
const [messagesError, setMessagesError] = useState(initialSnapshot.messagesError);
|
|
84
87
|
const [loadingOlderMessages, setLoadingOlderMessages] = useState(initialSnapshot.loadingOlderMessages);
|
|
85
88
|
const [hasOlderMessages, setHasOlderMessages] = useState(initialSnapshot.hasOlderMessages);
|
|
86
89
|
const [replyTo, setReplyTo] = useState<ChatMessage | null>(() => resolveReplyTo(initialSnapshot));
|
|
87
90
|
|
|
88
91
|
useEffect(() => {
|
|
89
|
-
return useDefaultControllerChannel
|
|
90
|
-
|
|
92
|
+
return useDefaultControllerChannel
|
|
93
|
+
? controller.attachView(focused)
|
|
94
|
+
: controller.attachChannelView(channelId, focused);
|
|
95
|
+
}, [channelId, controller, focused, useDefaultControllerChannel]);
|
|
91
96
|
|
|
92
97
|
useEffect(() => {
|
|
93
98
|
void controller.refreshChannels().catch(() => {});
|
|
@@ -109,6 +114,7 @@ export function useChatSnapshotState({
|
|
|
109
114
|
setHasSavedSession(snapshot.hasSavedSession);
|
|
110
115
|
setUser(snapshot.user);
|
|
111
116
|
setLoading(snapshot.loading);
|
|
117
|
+
setMessagesError(snapshot.messagesError);
|
|
112
118
|
setLoadingOlderMessages(snapshot.loadingOlderMessages);
|
|
113
119
|
setHasOlderMessages(snapshot.hasOlderMessages);
|
|
114
120
|
syncDraftFromSnapshot({
|
|
@@ -153,6 +159,7 @@ export function useChatSnapshotState({
|
|
|
153
159
|
loading,
|
|
154
160
|
loadingOlderMessages,
|
|
155
161
|
messages,
|
|
162
|
+
messagesError,
|
|
156
163
|
onlineCount,
|
|
157
164
|
replyTo,
|
|
158
165
|
setReplyTo,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Box, ScrollBox, Text, type ScrollBoxRenderable } from "../../../../ui";
|
|
2
2
|
import type { Dispatch, SetStateAction } from "react";
|
|
3
3
|
import type { InlineTickerCatalogEntry } from "../../../../state/hooks/inline-tickers";
|
|
4
|
+
import { Button } from "../../../../components";
|
|
4
5
|
import { colors } from "../../../../theme/colors";
|
|
5
6
|
import { t } from "../../../../i18n";
|
|
6
7
|
import type { ChatMessage, ChatUserSummary } from "../../../../api-client";
|
|
@@ -25,6 +26,8 @@ interface ChatTranscriptProps {
|
|
|
25
26
|
jumpToMessage: (messageId: string) => void;
|
|
26
27
|
loading: boolean;
|
|
27
28
|
loadingOlderMessages: boolean;
|
|
29
|
+
messagesError: string | null;
|
|
30
|
+
onRetryMessages: () => void;
|
|
28
31
|
messageAreaHeight: number;
|
|
29
32
|
messageBodyWidth: number;
|
|
30
33
|
messages: ChatMessage[];
|
|
@@ -57,6 +60,8 @@ export function ChatTranscript({
|
|
|
57
60
|
jumpToMessage,
|
|
58
61
|
loading,
|
|
59
62
|
loadingOlderMessages,
|
|
63
|
+
messagesError,
|
|
64
|
+
onRetryMessages,
|
|
60
65
|
messageAreaHeight,
|
|
61
66
|
messageBodyWidth,
|
|
62
67
|
messages,
|
|
@@ -97,6 +102,11 @@ export function ChatTranscript({
|
|
|
97
102
|
<Box alignItems="center" justifyContent="center" flexGrow={1}>
|
|
98
103
|
<Text fg={colors.textDim}>{t("Loading...")}</Text>
|
|
99
104
|
</Box>
|
|
105
|
+
) : messagesError && messages.length === 0 ? (
|
|
106
|
+
// A failed load must not read as an empty channel.
|
|
107
|
+
<Box alignItems="center" justifyContent="center" flexGrow={1} flexDirection="column" gap={1}>
|
|
108
|
+
<Text fg={colors.warning}>{messagesError}</Text>
|
|
109
|
+
</Box>
|
|
100
110
|
) : messages.length === 0 && (
|
|
101
111
|
<Box alignItems="center" justifyContent="center" flexGrow={1}>
|
|
102
112
|
<Text fg={colors.textDim}>{t("No messages yet. Be the first to say something!")}</Text>
|
|
@@ -68,20 +68,30 @@ export function attachChatChannelView({
|
|
|
68
68
|
channelId,
|
|
69
69
|
emit,
|
|
70
70
|
flushDraftSync,
|
|
71
|
+
focused,
|
|
72
|
+
appActive,
|
|
71
73
|
markViewedThroughLatestMessage,
|
|
72
74
|
}: {
|
|
73
75
|
channel: ChannelRuntimeState;
|
|
74
76
|
channelId: string;
|
|
75
77
|
emit: (channelId: string) => void;
|
|
76
78
|
flushDraftSync: (channelId: string) => void;
|
|
79
|
+
focused: boolean;
|
|
80
|
+
appActive: boolean;
|
|
77
81
|
markViewedThroughLatestMessage: (channelId: string) => boolean;
|
|
78
82
|
}): () => void {
|
|
79
83
|
channel.openViewCount += 1;
|
|
80
|
-
if (
|
|
84
|
+
if (focused) {
|
|
85
|
+
channel.focusedViewCount += 1;
|
|
86
|
+
}
|
|
87
|
+
if (focused && appActive && markViewedThroughLatestMessage(channelId)) {
|
|
81
88
|
emit(channelId);
|
|
82
89
|
}
|
|
83
90
|
return () => {
|
|
84
91
|
channel.openViewCount = Math.max(0, channel.openViewCount - 1);
|
|
92
|
+
if (focused) {
|
|
93
|
+
channel.focusedViewCount = Math.max(0, channel.focusedViewCount - 1);
|
|
94
|
+
}
|
|
85
95
|
flushDraftSync(channelId);
|
|
86
96
|
};
|
|
87
97
|
}
|
|
@@ -25,6 +25,7 @@ export class ChatControllerChannels {
|
|
|
25
25
|
private onlineCount = 0;
|
|
26
26
|
private channelsLoading = false;
|
|
27
27
|
private channelsPromise: Promise<void> | null = null;
|
|
28
|
+
private presencePromise: Promise<void> | null = null;
|
|
28
29
|
|
|
29
30
|
constructor(private readonly options: ChatControllerChannelsOptions) {}
|
|
30
31
|
|
|
@@ -82,10 +83,19 @@ export class ChatControllerChannels {
|
|
|
82
83
|
return request;
|
|
83
84
|
}
|
|
84
85
|
|
|
86
|
+
/** Single-flight: every open chat pane calls this on mount. */
|
|
85
87
|
async refreshPresence(): Promise<void> {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
if (this.presencePromise) return this.presencePromise;
|
|
89
|
+
const request = apiClient.getChatPresence()
|
|
90
|
+
.then((presence) => {
|
|
91
|
+
this.onlineCount = presence.onlineCount;
|
|
92
|
+
this.options.emit();
|
|
93
|
+
})
|
|
94
|
+
.finally(() => {
|
|
95
|
+
this.presencePromise = null;
|
|
96
|
+
});
|
|
97
|
+
this.presencePromise = request;
|
|
98
|
+
return request;
|
|
89
99
|
}
|
|
90
100
|
|
|
91
101
|
async refreshChatState(): Promise<void> {
|