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
|
@@ -214,6 +214,10 @@ export function createCommandBarCollectionWorkflowActions(options: {
|
|
|
214
214
|
});
|
|
215
215
|
await tickerRepository.saveTicker(result.ticker);
|
|
216
216
|
dispatch({ type: "UPDATE_TICKER", ticker: result.ticker });
|
|
217
|
+
pluginRegistry.events.emit("command-bar:portfolio-membership-persisted", {
|
|
218
|
+
symbol: result.ticker.metadata.ticker,
|
|
219
|
+
portfolioId: portfolio.id,
|
|
220
|
+
});
|
|
217
221
|
notify(`Set position for ${result.ticker.metadata.ticker} in "${portfolio.name}".`, { type: "success" });
|
|
218
222
|
},
|
|
219
223
|
|
|
@@ -236,11 +240,18 @@ export function createCommandBarCollectionWorkflowActions(options: {
|
|
|
236
240
|
if (result.changed) {
|
|
237
241
|
await tickerRepository.saveTicker(result.ticker);
|
|
238
242
|
dispatch({ type: "UPDATE_TICKER", ticker: result.ticker });
|
|
239
|
-
notify(`Added ${result.ticker.metadata.ticker} to "${portfolio.name}".`, { type: "success" });
|
|
240
|
-
return;
|
|
241
243
|
}
|
|
242
244
|
|
|
243
|
-
|
|
245
|
+
pluginRegistry.events.emit("command-bar:portfolio-membership-persisted", {
|
|
246
|
+
symbol: result.ticker.metadata.ticker,
|
|
247
|
+
portfolioId: portfolio.id,
|
|
248
|
+
});
|
|
249
|
+
notify(
|
|
250
|
+
result.changed
|
|
251
|
+
? `Added ${result.ticker.metadata.ticker} to "${portfolio.name}".`
|
|
252
|
+
: `${result.ticker.metadata.ticker} is already in "${portfolio.name}".`,
|
|
253
|
+
{ type: result.changed ? "success" : "info" },
|
|
254
|
+
);
|
|
244
255
|
},
|
|
245
256
|
|
|
246
257
|
async disconnectBrokerInstance(instanceId) {
|
|
@@ -122,6 +122,142 @@ describe("createPaneTemplateOrThrow", () => {
|
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
+
describe("createPaneTemplateOrThrow pane reuse", () => {
|
|
126
|
+
async function runTemplate(
|
|
127
|
+
spec: Record<string, unknown>,
|
|
128
|
+
existing: Array<Record<string, unknown>>,
|
|
129
|
+
): Promise<{
|
|
130
|
+
focused: string[];
|
|
131
|
+
created: number;
|
|
132
|
+
createdWith: Record<string, unknown> | null;
|
|
133
|
+
layouts: LayoutConfig[];
|
|
134
|
+
}> {
|
|
135
|
+
const config = createDefaultConfig("/tmp/gloomberb-workflow-ops-reuse");
|
|
136
|
+
const layout = cloneLayout(config.layout);
|
|
137
|
+
layout.instances = existing as never;
|
|
138
|
+
const state = createInitialState({ ...config, layout });
|
|
139
|
+
const focused: string[] = [];
|
|
140
|
+
const layouts: LayoutConfig[] = [];
|
|
141
|
+
let created = 0;
|
|
142
|
+
let createdWith: Record<string, unknown> | null = null;
|
|
143
|
+
|
|
144
|
+
await createPaneTemplateOrThrow("template", undefined, {
|
|
145
|
+
dataProvider: makeDataProvider() as any,
|
|
146
|
+
tickerRepository: makeTickerRepository() as any,
|
|
147
|
+
dispatch: () => {},
|
|
148
|
+
getState: () => state,
|
|
149
|
+
pluginRegistry: {
|
|
150
|
+
paneTemplates: new Map([
|
|
151
|
+
["template", {
|
|
152
|
+
id: "template",
|
|
153
|
+
paneId: "chat",
|
|
154
|
+
label: "Chat",
|
|
155
|
+
description: "Chat",
|
|
156
|
+
createInstance: () => spec,
|
|
157
|
+
}],
|
|
158
|
+
]),
|
|
159
|
+
panes: new Map([["chat", { id: "chat", name: "Chat", component: () => null }]]),
|
|
160
|
+
getPaneTemplatePluginId: () => undefined,
|
|
161
|
+
focusPaneFn: (paneId: string) => focused.push(paneId),
|
|
162
|
+
updateLayoutFn: (next: LayoutConfig) => {
|
|
163
|
+
layouts.push(next);
|
|
164
|
+
state.config.layout = next;
|
|
165
|
+
},
|
|
166
|
+
events: { emit: () => {} },
|
|
167
|
+
} as any,
|
|
168
|
+
buildPaneInstance: (_paneType: string, options?: Record<string, unknown>) => {
|
|
169
|
+
created += 1;
|
|
170
|
+
createdWith = options ?? null;
|
|
171
|
+
return { instanceId: "chat:new", paneId: "chat" } as any;
|
|
172
|
+
},
|
|
173
|
+
placePaneInstance: () => {},
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
return { focused, created, createdWith, layouts };
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// The pane rewrites its own channelId as the user switches channels inside it,
|
|
180
|
+
// so reuse has to move it back onto the requested channel before focusing.
|
|
181
|
+
test("retargets the instance a stable id owns when its persisted channel drifted", async () => {
|
|
182
|
+
const result = await runTemplate(
|
|
183
|
+
{ instanceId: "chat:general", title: "#general", settings: { channelId: "general" } },
|
|
184
|
+
[{
|
|
185
|
+
instanceId: "chat:general",
|
|
186
|
+
paneId: "chat",
|
|
187
|
+
title: "#random",
|
|
188
|
+
settings: { channelId: "random", fontScale: 2 },
|
|
189
|
+
}],
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
expect(result.focused).toEqual(["chat:general"]);
|
|
193
|
+
expect(result.created).toBe(0);
|
|
194
|
+
expect(findPaneInstance(result.layouts[0]!, "chat:general")).toMatchObject({
|
|
195
|
+
title: "#general",
|
|
196
|
+
settings: { channelId: "general", fontScale: 2 },
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
test("focuses a matching stable-id pane without rewriting the layout", async () => {
|
|
201
|
+
const result = await runTemplate(
|
|
202
|
+
{ instanceId: "chat:general", title: "#general", settings: { channelId: "general" } },
|
|
203
|
+
[{
|
|
204
|
+
instanceId: "chat:general",
|
|
205
|
+
paneId: "chat",
|
|
206
|
+
title: "#general",
|
|
207
|
+
settings: { channelId: "general" },
|
|
208
|
+
}],
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
expect(result.focused).toEqual(["chat:general"]);
|
|
212
|
+
expect(result.layouts).toEqual([]);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
test("never focuses another pane type holding the same stable id", async () => {
|
|
216
|
+
const result = await runTemplate(
|
|
217
|
+
{ instanceId: "chat:general", settings: { channelId: "general" } },
|
|
218
|
+
[{ instanceId: "chat:general", paneId: "notes", settings: { channelId: "general" } }],
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
expect(result.focused).toEqual([]);
|
|
222
|
+
expect(result.created).toBe(1);
|
|
223
|
+
// Reusing the taken id would put two panes on one instance id.
|
|
224
|
+
expect(result.createdWith).toMatchObject({ instanceId: undefined });
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
test("keeps a different stable id on its own pane", async () => {
|
|
228
|
+
const result = await runTemplate(
|
|
229
|
+
{ instanceId: "chat:trading", settings: { channelId: "trading" } },
|
|
230
|
+
[{ instanceId: "chat:general", paneId: "chat", settings: { channelId: "general" } }],
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
expect(result.focused).toEqual([]);
|
|
234
|
+
expect(result.created).toBe(1);
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
test("reuses an unkeyed template only on an equivalent spec, ignoring settings key order", async () => {
|
|
238
|
+
const existing = [{
|
|
239
|
+
instanceId: "chat:stored",
|
|
240
|
+
paneId: "chat",
|
|
241
|
+
binding: { kind: "fixed", symbol: "AAPL" },
|
|
242
|
+
settings: { limit: 10, channelId: "general" },
|
|
243
|
+
}];
|
|
244
|
+
|
|
245
|
+
const same = await runTemplate(
|
|
246
|
+
{ binding: { kind: "fixed", symbol: "AAPL" }, settings: { channelId: "general", limit: 10 } },
|
|
247
|
+
existing,
|
|
248
|
+
);
|
|
249
|
+
expect(same.focused).toEqual(["chat:stored"]);
|
|
250
|
+
expect(same.created).toBe(0);
|
|
251
|
+
|
|
252
|
+
const different = await runTemplate(
|
|
253
|
+
{ binding: { kind: "fixed", symbol: "MSFT" }, settings: { channelId: "general", limit: 10 } },
|
|
254
|
+
existing,
|
|
255
|
+
);
|
|
256
|
+
expect(different.focused).toEqual([]);
|
|
257
|
+
expect(different.created).toBe(1);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
|
|
125
261
|
describe("applyPaneSettingFieldValue", () => {
|
|
126
262
|
test("lets a pane map derived setting fields back to its canonical settings object", async () => {
|
|
127
263
|
const config = createDefaultConfig("/tmp/gloomberb-workflow-ops-test");
|
|
@@ -78,6 +78,60 @@ function updateTickerListPane(
|
|
|
78
78
|
}));
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
/** Key order in stored settings is not guaranteed, so compare on sorted keys. */
|
|
82
|
+
function stableKey(value: unknown): string {
|
|
83
|
+
return JSON.stringify(value, (_key, entry) => (
|
|
84
|
+
entry && typeof entry === "object" && !Array.isArray(entry)
|
|
85
|
+
? Object.fromEntries(Object.entries(entry as Record<string, unknown>).sort(
|
|
86
|
+
([left], [right]) => left.localeCompare(right),
|
|
87
|
+
))
|
|
88
|
+
: entry
|
|
89
|
+
));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Find the pane a template would otherwise duplicate. A template that owns a
|
|
94
|
+
* stable instance id (Chat keys one pane per channel) claims that instance even
|
|
95
|
+
* after its settings drifted at runtime, as long as the id still belongs to the
|
|
96
|
+
* same kind of pane; everything else has to match the whole create spec, so a
|
|
97
|
+
* different ticker, collection or setting still opens its own pane.
|
|
98
|
+
*/
|
|
99
|
+
function findReusablePaneInstance(
|
|
100
|
+
instances: PaneInstanceConfig[],
|
|
101
|
+
paneId: string,
|
|
102
|
+
spec: PaneTemplateInstanceConfig,
|
|
103
|
+
): PaneInstanceConfig | null {
|
|
104
|
+
if (spec.instanceId) {
|
|
105
|
+
const owner = instances.find((instance) => instance.instanceId === spec.instanceId);
|
|
106
|
+
return owner?.paneId === paneId ? owner : null;
|
|
107
|
+
}
|
|
108
|
+
const specKey = stableKey([spec.binding ?? { kind: "none" }, spec.params ?? {}, spec.settings ?? {}]);
|
|
109
|
+
return instances.find((instance) => (
|
|
110
|
+
instance.paneId === paneId
|
|
111
|
+
&& stableKey([instance.binding ?? { kind: "none" }, instance.params ?? {}, instance.settings ?? {}]) === specKey
|
|
112
|
+
)) ?? null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* A stable-id pane outlives the spec that opened it (Chat rewrites its own
|
|
117
|
+
* channelId as the user switches channels inside the pane), so reuse has to put
|
|
118
|
+
* the pane back on the requested spec before focusing it, or the command lands
|
|
119
|
+
* on a pane showing something else. Returns null when nothing has to change.
|
|
120
|
+
*/
|
|
121
|
+
function retargetPaneInstance(
|
|
122
|
+
instance: PaneInstanceConfig,
|
|
123
|
+
spec: PaneTemplateInstanceConfig,
|
|
124
|
+
): PaneInstanceConfig | null {
|
|
125
|
+
const next: PaneInstanceConfig = {
|
|
126
|
+
...instance,
|
|
127
|
+
title: spec.title ?? instance.title,
|
|
128
|
+
binding: spec.binding ?? instance.binding,
|
|
129
|
+
params: spec.params ? { ...(instance.params ?? {}), ...spec.params } : instance.params,
|
|
130
|
+
settings: spec.settings ? { ...(instance.settings ?? {}), ...spec.settings } : instance.settings,
|
|
131
|
+
};
|
|
132
|
+
return stableKey(next) === stableKey(instance) ? null : next;
|
|
133
|
+
}
|
|
134
|
+
|
|
81
135
|
async function resolvePaneTemplateOptions(
|
|
82
136
|
template: PaneTemplateDef,
|
|
83
137
|
options: PaneTemplateCreateOptions | undefined,
|
|
@@ -163,8 +217,24 @@ export async function createPaneTemplateOrThrow(
|
|
|
163
217
|
throw new Error(`Unknown pane "${template.paneId}".`);
|
|
164
218
|
}
|
|
165
219
|
|
|
220
|
+
const instances = deps.getState().config.layout.instances;
|
|
221
|
+
const existing = findReusablePaneInstance(instances, template.paneId, spec);
|
|
222
|
+
if (existing) {
|
|
223
|
+
const retargeted = retargetPaneInstance(existing, spec);
|
|
224
|
+
if (retargeted) {
|
|
225
|
+
deps.pluginRegistry.updateLayoutFn(updatePaneInstance(
|
|
226
|
+
deps.getState().config.layout,
|
|
227
|
+
existing.instanceId,
|
|
228
|
+
() => retargeted,
|
|
229
|
+
));
|
|
230
|
+
}
|
|
231
|
+
deps.pluginRegistry.focusPaneFn(existing.instanceId);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
|
|
166
235
|
const instance = deps.buildPaneInstance(template.paneId, {
|
|
167
|
-
|
|
236
|
+
// A stable id another pane type already holds would collide, so the new pane picks its own.
|
|
237
|
+
instanceId: instances.some((entry) => entry.instanceId === spec.instanceId) ? undefined : spec.instanceId,
|
|
168
238
|
title: spec.title,
|
|
169
239
|
binding: spec.binding,
|
|
170
240
|
params: spec.params,
|
package/src/components/index.ts
CHANGED
|
@@ -42,7 +42,7 @@ export { ConfirmDialog } from "./ui/confirm-dialog";
|
|
|
42
42
|
export { ChoiceDialog } from "./ui/choice-dialog";
|
|
43
43
|
export type { ChoiceDialogChoice } from "./ui/choice-dialog";
|
|
44
44
|
export type { DataTableCell, DataTableColumn, DataTableVisibleRange } from "./ui/data-table";
|
|
45
|
-
export { EmptyState } from "./ui/status";
|
|
45
|
+
export { EmptyState, PaneStatusBody, loadingText, unavailableText } from "./ui/status";
|
|
46
46
|
export { getMessageComposerBlockHeight, MessageComposer } from "./ui/message-composer";
|
|
47
47
|
export { NumberField, TextField } from "./ui/fields";
|
|
48
48
|
export { SegmentedControl } from "./ui/toggle";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { afterEach, expect, test } from "bun:test";
|
|
2
|
+
import { testRender } from "../../renderers/opentui/test-utils";
|
|
3
|
+
import { AppContext, createInitialState } from "../../state/app/context";
|
|
4
|
+
import { createDefaultConfig } from "../../types/config";
|
|
5
|
+
import { VERSION } from "../../version";
|
|
6
|
+
import { act } from "react";
|
|
7
|
+
import { Header } from "./header";
|
|
8
|
+
|
|
9
|
+
let testSetup: Awaited<ReturnType<typeof testRender>> | undefined;
|
|
10
|
+
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
testSetup?.renderer.destroy();
|
|
13
|
+
testSetup = undefined;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test("opens the current version changelog from the header", async () => {
|
|
17
|
+
let openedVersion = "";
|
|
18
|
+
const state = createInitialState(createDefaultConfig("/tmp/gloomberb-header-test"));
|
|
19
|
+
testSetup = await testRender(
|
|
20
|
+
<AppContext value={{ state, dispatch: () => {} }}>
|
|
21
|
+
<Header onOpenChangelog={(version) => { openedVersion = version; }} />
|
|
22
|
+
</AppContext>,
|
|
23
|
+
{ width: 100, height: 1 },
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
await testSetup.renderOnce();
|
|
27
|
+
const versionX = testSetup.captureCharFrame().indexOf(`v${VERSION}`);
|
|
28
|
+
expect(versionX).toBeGreaterThanOrEqual(0);
|
|
29
|
+
|
|
30
|
+
await act(async () => {
|
|
31
|
+
await testSetup!.mockMouse.click(versionX + 1, 0);
|
|
32
|
+
await testSetup!.renderOnce();
|
|
33
|
+
});
|
|
34
|
+
expect(openedVersion).toBe(VERSION);
|
|
35
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, SpinnerMark, Text, TextAttributes, useRendererHost, useUiCapabilities } from "../../ui";
|
|
2
|
-
import { useCallback, useEffect, type ReactNode } from "react";
|
|
2
|
+
import { useCallback, useEffect, useState, type ReactNode } from "react";
|
|
3
3
|
import { blendHex, priceColor } from "../../theme/colors";
|
|
4
4
|
import { useThemeColors } from "../../theme/theme-context";
|
|
5
5
|
import { useAppActive } from "../../state/app/activity";
|
|
@@ -16,7 +16,7 @@ import { t, tf } from "../../i18n";
|
|
|
16
16
|
import { useQuoteEntry, useResolvedEntryValue } from "../../market-data/hooks";
|
|
17
17
|
import { formatPercentRaw } from "../../utils/format";
|
|
18
18
|
import { formatMarketPrice } from "../../market-data/market/format";
|
|
19
|
-
import {
|
|
19
|
+
import { getActiveQuoteDisplay, marketStateColor, marketStateCountdown, marketStateLabel } from "../../market-data/market/status";
|
|
20
20
|
import { VERSION } from "../../version";
|
|
21
21
|
import { getTitlebarLeadingInset } from "./titlebar-overlay";
|
|
22
22
|
import { WindowControls, WINDOWS_CONTROL_GROUP_WIDTH_PX } from "./window-controls";
|
|
@@ -24,14 +24,24 @@ import { WindowControls, WINDOWS_CONTROL_GROUP_WIDTH_PX } from "./window-control
|
|
|
24
24
|
const SPY_REFRESH_MS = 5 * 60_000; // 5 min
|
|
25
25
|
const UPDATE_NOTICE_DURATION_MS = 5_000;
|
|
26
26
|
|
|
27
|
+
type HeaderActionEvent = {
|
|
28
|
+
key?: string;
|
|
29
|
+
preventDefault?: () => void;
|
|
30
|
+
stopPropagation?: () => void;
|
|
31
|
+
};
|
|
32
|
+
|
|
27
33
|
function DesktopHeaderPill({
|
|
28
34
|
children,
|
|
29
35
|
backgroundColor,
|
|
30
36
|
borderColor,
|
|
37
|
+
onPress,
|
|
38
|
+
ariaLabel,
|
|
31
39
|
}: {
|
|
32
40
|
children: ReactNode;
|
|
33
41
|
backgroundColor?: string;
|
|
34
42
|
borderColor?: string;
|
|
43
|
+
onPress?: (event?: HeaderActionEvent) => void;
|
|
44
|
+
ariaLabel?: string;
|
|
35
45
|
}) {
|
|
36
46
|
const colors = useThemeColors();
|
|
37
47
|
const resolvedBackgroundColor = backgroundColor ?? blendHex(colors.header, colors.bg, 0.28);
|
|
@@ -42,10 +52,20 @@ function DesktopHeaderPill({
|
|
|
42
52
|
flexDirection="row"
|
|
43
53
|
alignItems="center"
|
|
44
54
|
backgroundColor={resolvedBackgroundColor}
|
|
55
|
+
data-gloom-interactive={onPress ? "true" : undefined}
|
|
56
|
+
role={onPress ? "button" : undefined}
|
|
57
|
+
tabIndex={onPress ? 0 : undefined}
|
|
58
|
+
aria-label={ariaLabel}
|
|
59
|
+
onMouseDown={onPress}
|
|
60
|
+
onKeyDown={(event: HeaderActionEvent) => {
|
|
61
|
+
if (event.key === "Enter" || event.key === " ") onPress?.(event);
|
|
62
|
+
}}
|
|
63
|
+
hoverBackgroundColor={onPress ? blendHex(resolvedBackgroundColor, colors.headerText, 0.12) : undefined}
|
|
45
64
|
style={{
|
|
46
65
|
border: `1px solid ${resolvedBorderColor}`,
|
|
47
66
|
borderRadius: 5,
|
|
48
67
|
paddingInline: 6,
|
|
68
|
+
cursor: onPress ? "pointer" : undefined,
|
|
49
69
|
}}
|
|
50
70
|
>
|
|
51
71
|
{children}
|
|
@@ -133,7 +153,13 @@ function UpdateStatus() {
|
|
|
133
153
|
return null;
|
|
134
154
|
}
|
|
135
155
|
|
|
136
|
-
export function Header(
|
|
156
|
+
export function Header({
|
|
157
|
+
onOpenHelp,
|
|
158
|
+
onOpenChangelog,
|
|
159
|
+
}: {
|
|
160
|
+
onOpenHelp?: () => void;
|
|
161
|
+
onOpenChangelog?: (version: string) => void;
|
|
162
|
+
}) {
|
|
137
163
|
const colors = useThemeColors();
|
|
138
164
|
const rendererHost = useRendererHost();
|
|
139
165
|
const baseCurrency = useAppSelector(selectBaseCurrency);
|
|
@@ -143,6 +169,15 @@ export function Header() {
|
|
|
143
169
|
const titlebarLeadingInset = titleBarOverlay ? getTitlebarLeadingInset() : 0;
|
|
144
170
|
const spyQuoteEntry = useQuoteEntry("SPY", null);
|
|
145
171
|
const spyQuote = useResolvedEntryValue(spyQuoteEntry);
|
|
172
|
+
const mktState = spyQuote?.marketState;
|
|
173
|
+
const [now, setNow] = useState(Date.now());
|
|
174
|
+
|
|
175
|
+
useEffect(() => {
|
|
176
|
+
if (!appActive || (mktState !== "PRE" && mktState !== "REGULAR")) return;
|
|
177
|
+
setNow(Date.now());
|
|
178
|
+
const id = setInterval(() => setNow(Date.now()), 1_000);
|
|
179
|
+
return () => clearInterval(id);
|
|
180
|
+
}, [appActive, mktState]);
|
|
146
181
|
|
|
147
182
|
useEffect(() => {
|
|
148
183
|
if (!appActive) return;
|
|
@@ -168,10 +203,24 @@ export function Header() {
|
|
|
168
203
|
}, [rendererHost, titleBarOverlay]);
|
|
169
204
|
|
|
170
205
|
// Market status
|
|
171
|
-
const
|
|
172
|
-
const mktLabel = mktState
|
|
206
|
+
const mktCountdown = mktState ? marketStateCountdown(mktState, now) : null;
|
|
207
|
+
const mktLabel = mktState
|
|
208
|
+
? `${t(marketStateLabel(mktState))}${mktCountdown ? ` · ${mktCountdown}` : ""}`
|
|
209
|
+
: "";
|
|
173
210
|
const mktColor = mktState ? marketStateColor(mktState, colors) : colors.headerText;
|
|
174
211
|
|
|
212
|
+
const openChangelog = useCallback((event?: HeaderActionEvent) => {
|
|
213
|
+
event?.preventDefault?.();
|
|
214
|
+
event?.stopPropagation?.();
|
|
215
|
+
onOpenChangelog?.(VERSION);
|
|
216
|
+
}, [onOpenChangelog]);
|
|
217
|
+
|
|
218
|
+
const openHelp = useCallback((event?: HeaderActionEvent) => {
|
|
219
|
+
event?.preventDefault?.();
|
|
220
|
+
event?.stopPropagation?.();
|
|
221
|
+
onOpenHelp?.();
|
|
222
|
+
}, [onOpenHelp]);
|
|
223
|
+
|
|
175
224
|
if (titleBarOverlay) {
|
|
176
225
|
return (
|
|
177
226
|
<Box
|
|
@@ -196,6 +245,8 @@ export function Header() {
|
|
|
196
245
|
<DesktopHeaderPill
|
|
197
246
|
backgroundColor={blendHex(colors.header, colors.headerText, 0.1)}
|
|
198
247
|
borderColor={blendHex(colors.border, colors.headerText, 0.28)}
|
|
248
|
+
onPress={onOpenChangelog ? openChangelog : undefined}
|
|
249
|
+
ariaLabel={onOpenChangelog ? `Open changelog for v${VERSION}` : undefined}
|
|
199
250
|
>
|
|
200
251
|
<Text fg={colors.headerText} style={{ fontSize: 11 }}>v{VERSION}</Text>
|
|
201
252
|
</DesktopHeaderPill>
|
|
@@ -203,6 +254,35 @@ export function Header() {
|
|
|
203
254
|
<Box flexGrow={1} paddingLeft={2} paddingRight={2} minWidth={0}>
|
|
204
255
|
<UpdateStatus />
|
|
205
256
|
</Box>
|
|
257
|
+
{onOpenHelp ? (
|
|
258
|
+
<Box
|
|
259
|
+
height={1}
|
|
260
|
+
flexDirection="row"
|
|
261
|
+
alignItems="center"
|
|
262
|
+
data-gloom-role="header-help-action"
|
|
263
|
+
data-gloom-interactive="true"
|
|
264
|
+
role="button"
|
|
265
|
+
tabIndex={0}
|
|
266
|
+
aria-label="Open Help"
|
|
267
|
+
aria-keyshortcuts="?"
|
|
268
|
+
onMouseDown={openHelp}
|
|
269
|
+
onKeyDown={(event: { key?: string; preventDefault?: () => void; stopPropagation?: () => void }) => {
|
|
270
|
+
if (event.key === "Enter" || event.key === " ") openHelp(event);
|
|
271
|
+
}}
|
|
272
|
+
hoverBackgroundColor={blendHex(colors.header, colors.headerText, 0.15)}
|
|
273
|
+
style={{
|
|
274
|
+
border: `1px solid ${blendHex(colors.border, colors.headerText, 0.28)}`,
|
|
275
|
+
borderRadius: 5,
|
|
276
|
+
paddingInline: 7,
|
|
277
|
+
marginRight: 8,
|
|
278
|
+
backgroundColor: blendHex(colors.header, colors.headerText, 0.08),
|
|
279
|
+
cursor: "pointer",
|
|
280
|
+
}}
|
|
281
|
+
>
|
|
282
|
+
<Text fg={colors.headerText} style={{ fontSize: 11, fontWeight: 700 }}>Help</Text>
|
|
283
|
+
<Text fg={blendHex(colors.headerText, colors.header, 0.38)} style={{ marginLeft: 6, fontSize: 10 }}>?</Text>
|
|
284
|
+
</Box>
|
|
285
|
+
) : null}
|
|
206
286
|
{mktLabel ? (
|
|
207
287
|
<Box paddingRight={1}>
|
|
208
288
|
<DesktopHeaderPill
|
|
@@ -234,10 +314,22 @@ export function Header() {
|
|
|
234
314
|
data-titlebar-overlay={titleBarOverlay ? "true" : undefined}
|
|
235
315
|
onMouseDown={startWindowDrag}
|
|
236
316
|
>
|
|
237
|
-
<Box paddingLeft={titleBarOverlay ? titlebarLeadingInset : 1}>
|
|
238
|
-
<Text attributes={TextAttributes.BOLD} fg={colors.headerText}>
|
|
239
|
-
|
|
240
|
-
|
|
317
|
+
<Box paddingLeft={titleBarOverlay ? titlebarLeadingInset : 1} flexDirection="row">
|
|
318
|
+
<Text attributes={TextAttributes.BOLD} fg={colors.headerText}>Gloomberb </Text>
|
|
319
|
+
<Box
|
|
320
|
+
data-gloom-interactive={onOpenChangelog ? "true" : undefined}
|
|
321
|
+
role={onOpenChangelog ? "button" : undefined}
|
|
322
|
+
tabIndex={onOpenChangelog ? 0 : undefined}
|
|
323
|
+
aria-label={onOpenChangelog ? `Open changelog for v${VERSION}` : undefined}
|
|
324
|
+
onMouseDown={onOpenChangelog ? openChangelog : undefined}
|
|
325
|
+
onKeyDown={(event: HeaderActionEvent) => {
|
|
326
|
+
if (event.key === "Enter" || event.key === " ") openChangelog(event);
|
|
327
|
+
}}
|
|
328
|
+
hoverBackgroundColor={onOpenChangelog ? blendHex(colors.header, colors.headerText, 0.15) : undefined}
|
|
329
|
+
style={{ cursor: onOpenChangelog ? "pointer" : undefined }}
|
|
330
|
+
>
|
|
331
|
+
<Text attributes={TextAttributes.BOLD} fg={colors.headerText}>v{VERSION}</Text>
|
|
332
|
+
</Box>
|
|
241
333
|
</Box>
|
|
242
334
|
<Box flexGrow={1} paddingLeft={2}>
|
|
243
335
|
<UpdateStatus />
|
|
@@ -21,11 +21,11 @@ afterEach(async () => {
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
function Registration({
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
onOpen,
|
|
25
|
+
openDisabled = false,
|
|
26
26
|
}: {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
onOpen?: () => void;
|
|
28
|
+
openDisabled?: boolean;
|
|
29
29
|
}) {
|
|
30
30
|
usePaneFooter("test", () => {
|
|
31
31
|
return {
|
|
@@ -39,10 +39,10 @@ function Registration({
|
|
|
39
39
|
},
|
|
40
40
|
],
|
|
41
41
|
hints: [
|
|
42
|
-
{ id: "
|
|
42
|
+
{ id: "open", key: "o", label: "pen", onPress: onOpen, disabled: openDisabled },
|
|
43
43
|
],
|
|
44
44
|
};
|
|
45
|
-
}, [
|
|
45
|
+
}, [onOpen, openDisabled]);
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -78,18 +78,18 @@ function TranslatedFooterHarness() {
|
|
|
78
78
|
|
|
79
79
|
function FooterHarness({
|
|
80
80
|
focused = false,
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
onOpen,
|
|
82
|
+
openDisabled = false,
|
|
83
83
|
}: {
|
|
84
84
|
focused?: boolean;
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
onOpen?: () => void;
|
|
86
|
+
openDisabled?: boolean;
|
|
87
87
|
}) {
|
|
88
88
|
return (
|
|
89
89
|
<PaneFooterProvider>
|
|
90
90
|
{(footer) => (
|
|
91
91
|
<Box width={64} height={1}>
|
|
92
|
-
<Registration
|
|
92
|
+
<Registration onOpen={onOpen} openDisabled={openDisabled} />
|
|
93
93
|
<PaneFooterBar footer={footer} focused={focused} width={64} />
|
|
94
94
|
</Box>
|
|
95
95
|
)}
|
|
@@ -141,7 +141,7 @@ describe("PaneFooterBar", () => {
|
|
|
141
141
|
|
|
142
142
|
const frame = testSetup.captureCharFrame();
|
|
143
143
|
expect(frame).toContain("Rows 12");
|
|
144
|
-
expect(frame).not.toContain("[
|
|
144
|
+
expect(frame).not.toContain("[o]pen");
|
|
145
145
|
});
|
|
146
146
|
|
|
147
147
|
test("keeps raw external URLs out of footer text", async () => {
|
|
@@ -159,7 +159,7 @@ describe("PaneFooterBar", () => {
|
|
|
159
159
|
|
|
160
160
|
test("omits disabled controls instead of rendering muted hints", async () => {
|
|
161
161
|
testSetup = await testRender(
|
|
162
|
-
<FooterHarness focused
|
|
162
|
+
<FooterHarness focused openDisabled onOpen={() => {}} />,
|
|
163
163
|
{ width: 64, height: 1 },
|
|
164
164
|
);
|
|
165
165
|
await act(async () => {
|
|
@@ -169,31 +169,31 @@ describe("PaneFooterBar", () => {
|
|
|
169
169
|
|
|
170
170
|
const frame = testSetup.captureCharFrame();
|
|
171
171
|
expect(frame).toContain("Rows 12");
|
|
172
|
-
expect(frame).not.toContain("[
|
|
172
|
+
expect(frame).not.toContain("[o]pen");
|
|
173
173
|
});
|
|
174
174
|
|
|
175
175
|
test("calls hint onPress from mouse interaction", async () => {
|
|
176
|
-
let
|
|
177
|
-
testSetup = await testRender(<FooterHarness focused
|
|
176
|
+
let openCount = 0;
|
|
177
|
+
testSetup = await testRender(<FooterHarness focused onOpen={() => { openCount += 1; }} />, { width: 64, height: 1 });
|
|
178
178
|
await act(async () => {
|
|
179
179
|
await testSetup!.renderOnce();
|
|
180
180
|
await testSetup!.renderOnce();
|
|
181
181
|
});
|
|
182
182
|
|
|
183
183
|
const line = testSetup.captureCharFrame().split("\n")[0] ?? "";
|
|
184
|
-
const col = line.indexOf("[
|
|
184
|
+
const col = line.indexOf("[o]pen");
|
|
185
185
|
expect(col).toBeGreaterThanOrEqual(0);
|
|
186
186
|
|
|
187
187
|
await act(async () => {
|
|
188
188
|
await testSetup!.mockMouse.release(col + 1, 0);
|
|
189
189
|
await testSetup!.renderOnce();
|
|
190
190
|
});
|
|
191
|
-
expect(
|
|
191
|
+
expect(openCount).toBe(0);
|
|
192
192
|
|
|
193
193
|
await act(async () => {
|
|
194
194
|
await testSetup!.mockMouse.click(col + 1, 0);
|
|
195
195
|
await testSetup!.renderOnce();
|
|
196
196
|
});
|
|
197
|
-
expect(
|
|
197
|
+
expect(openCount).toBe(1);
|
|
198
198
|
});
|
|
199
199
|
});
|
|
@@ -2,6 +2,7 @@ import { Box, Span, Text, useNativeRenderer, useUiCapabilities } from "../../../
|
|
|
2
2
|
import { useCallback, useRef, type ReactNode } from "react";
|
|
3
3
|
import { blendHex, colors, floatingPaneTitleBg, paneTitleBg, paneTitleText } from "../../../theme/colors";
|
|
4
4
|
import { displayWidth, truncateToDisplayWidth } from "../../../utils/format";
|
|
5
|
+
import { capturePointerDrag } from "../../../ui/pointer-drag";
|
|
5
6
|
|
|
6
7
|
const PANE_HEADER_HEIGHT = 1;
|
|
7
8
|
const PANE_HEADER_GRIP = ":: ";
|
|
@@ -38,18 +39,6 @@ function truncateTitle(title: string, maxWidth: number): string {
|
|
|
38
39
|
return truncateToDisplayWidth(title, maxWidth);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
function captureTerminalPointerDrag(renderer: unknown, renderable: unknown): void {
|
|
42
|
-
if (!renderable) return;
|
|
43
|
-
const hostCapture = (renderer as { captureMouseRenderable?: (target: unknown) => void }).captureMouseRenderable;
|
|
44
|
-
if (typeof hostCapture === "function") {
|
|
45
|
-
hostCapture.call(renderer, renderable);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const capture = (renderer as { setCapturedRenderable?: (target: unknown) => void }).setCapturedRenderable;
|
|
49
|
-
if (typeof capture !== "function") return;
|
|
50
|
-
capture.call(renderer, renderable);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
42
|
function DesktopPaneButton({
|
|
54
43
|
icon,
|
|
55
44
|
onMouseDown,
|
|
@@ -148,7 +137,7 @@ export function PaneHeader({
|
|
|
148
137
|
const terminalQuickSettingsWidth = quickSettings.reduce((total) => total + displayWidth(" ⚡ "), 0);
|
|
149
138
|
const textColor = paneTitleText(visuallyFocused, floating);
|
|
150
139
|
const handleTerminalHeaderMouseDown = useCallback((event: any) => {
|
|
151
|
-
|
|
140
|
+
capturePointerDrag(nativeRenderer, terminalHeaderRef.current);
|
|
152
141
|
onHeaderMouseDown?.(event);
|
|
153
142
|
}, [nativeRenderer, onHeaderMouseDown]);
|
|
154
143
|
|
|
@@ -58,6 +58,7 @@ import {
|
|
|
58
58
|
useShellResolvedPanes,
|
|
59
59
|
useShellVisibleLayout,
|
|
60
60
|
} from "./layout-state";
|
|
61
|
+
import { DeviceSignInDialogHost } from "../../../plugins/builtin/cloud/device-signin-dialog";
|
|
61
62
|
import { useShellPaneActions } from "./pane/actions";
|
|
62
63
|
import { resolvePaneFocusSourceLayout } from "./fullscreen";
|
|
63
64
|
import { useTransientLayout } from "../transient-layout";
|
|
@@ -559,6 +560,8 @@ export function Shell({
|
|
|
559
560
|
}
|
|
560
561
|
: {})}
|
|
561
562
|
>
|
|
563
|
+
{/* Renders nothing; gives the QR sign-in command an always-mounted component with dialog access. */}
|
|
564
|
+
<DeviceSignInDialogHost />
|
|
562
565
|
<Box
|
|
563
566
|
position="absolute"
|
|
564
567
|
left={0}
|