gloomberb 0.7.5 → 0.8.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/README.md +27 -6
- package/package.json +2 -3
- package/src/api-client/auth.ts +167 -0
- package/src/api-client/chat.ts +116 -0
- package/src/api-client/data.ts +177 -0
- package/src/api-client/errors.ts +28 -0
- package/src/api-client/index.test.ts +675 -0
- package/src/api-client/index.ts +384 -0
- package/src/api-client/normalizers.ts +61 -0
- package/src/api-client/paths.ts +173 -0
- package/src/api-client/request.ts +124 -0
- package/src/api-client/socket.ts +483 -0
- package/src/api-client/types.ts +490 -0
- package/src/app/app-bootstrap-state.test.ts +157 -0
- package/src/app/app-bootstrap-state.ts +134 -0
- package/src/app/global-shortcuts.test.tsx +166 -0
- package/src/app/global-shortcuts.ts +126 -0
- package/src/app/pane-runtime/index.tsx +297 -0
- package/src/app/pane-runtime/layout-placement.ts +73 -0
- package/src/app/pane-runtime/pane-settings-runtime.tsx +67 -0
- package/src/app/pane-runtime/pane-template-runtime.ts +110 -0
- package/src/app/pane-runtime/plugin-bindings.ts +231 -0
- package/src/app/pane-runtime/ticker-inspector-runtime.ts +167 -0
- package/src/app/pane-runtime/ticker-open-runtime.ts +144 -0
- package/src/app/pane-template-dialog-wizard.tsx +52 -0
- package/src/app/runtime/broker-import.ts +109 -0
- package/src/app/runtime/desktop-menu.ts +74 -0
- package/src/app/runtime/plugin-bindings.ts +246 -0
- package/src/app/runtime/startup.ts +126 -0
- package/src/app/runtime/ticker-refresh.ts +249 -0
- package/src/app/runtime/update.ts +86 -0
- package/src/app.tsx +107 -1487
- package/src/brokers/broker-portfolio-sync.ts +186 -0
- package/src/brokers/broker-ticker-sync.ts +141 -0
- package/src/brokers/profile-form.ts +2 -2
- package/src/brokers/remote-broker-adapter.ts +3 -2
- package/src/brokers/sync-broker-instance.test.ts +140 -0
- package/src/brokers/sync-broker-instance.ts +60 -181
- package/src/capabilities/types.ts +4 -4
- package/src/cli/commands/search.ts +1 -1
- package/src/cli/commands/ticker.ts +3 -3
- package/src/cli/context.ts +1 -1
- package/src/cli/desktop-pane-shot.ts +305 -0
- package/src/cli/helpers.ts +1 -1
- package/src/cli/index.ts +34 -0
- package/src/cli/pane-functions/catalog.ts +243 -0
- package/src/cli/pane-functions/data.ts +78 -0
- package/src/cli/pane-functions/discovery.ts +113 -0
- package/src/cli/pane-functions/index.test.ts +114 -0
- package/src/cli/pane-functions/index.ts +112 -0
- package/src/cli/pane-functions/options.ts +249 -0
- package/src/cli/pane-functions/report.ts +180 -0
- package/src/cli/pane-functions/resolver.ts +96 -0
- package/src/cli/pane-functions/screenshot.ts +113 -0
- package/src/cli/registry.ts +3 -2
- package/src/cli/ticker-resolution.ts +1 -1
- package/src/cli.test.ts +1 -1
- package/src/components/chart/bar-chart-renderer.test.ts +53 -0
- package/src/components/chart/bar-chart-renderer.ts +190 -0
- package/src/components/chart/comparison/data.test.ts +105 -0
- package/src/components/chart/comparison/data.ts +279 -0
- package/src/components/chart/comparison/renderer.test.ts +187 -0
- package/src/components/chart/comparison/renderer.ts +283 -0
- package/src/components/chart/comparison/scene.ts +178 -0
- package/src/components/chart/comparison-stock-chart/axis-width.ts +99 -0
- package/src/components/chart/comparison-stock-chart/canvas.ts +148 -0
- package/src/components/chart/comparison-stock-chart/controls.ts +252 -0
- package/src/components/chart/comparison-stock-chart/helpers.ts +133 -0
- package/src/components/chart/comparison-stock-chart/interactions.ts +202 -0
- package/src/components/chart/comparison-stock-chart/layout-metrics.ts +62 -0
- package/src/components/chart/comparison-stock-chart/layout.tsx +155 -0
- package/src/components/chart/comparison-stock-chart/legend.tsx +73 -0
- package/src/components/chart/comparison-stock-chart/native-surfaces.ts +89 -0
- package/src/components/chart/comparison-stock-chart/render-data.ts +198 -0
- package/src/components/chart/comparison-stock-chart/render-output.ts +145 -0
- package/src/components/chart/comparison-stock-chart/selection-runtime.ts +111 -0
- package/src/components/chart/comparison-stock-chart/sources.ts +47 -0
- package/src/components/chart/comparison-stock-chart/surface-runtime.ts +159 -0
- package/src/components/chart/comparison-stock-chart/toolbar.tsx +107 -0
- package/src/components/chart/comparison-stock-chart/types.ts +22 -0
- package/src/components/chart/comparison-stock-chart/view.tsx +524 -0
- package/src/components/chart/comparison-stock-chart/viewport-runtime.ts +239 -0
- package/src/components/chart/comparison-stock-chart.tsx +12 -2028
- package/src/components/chart/core/axis-format.ts +147 -0
- package/src/components/chart/core/axis-measure.ts +33 -0
- package/src/components/chart/core/controller.test.ts +157 -0
- package/src/components/chart/core/controller.ts +349 -0
- package/src/components/chart/core/data.ts +94 -0
- package/src/components/chart/core/date-window.ts +392 -0
- package/src/components/chart/core/index.test.ts +1007 -0
- package/src/components/chart/core/indicator-selector.tsx +75 -0
- package/src/components/chart/core/keyboard.ts +15 -0
- package/src/components/chart/core/palette.ts +60 -0
- package/src/components/chart/core/pane-settings.test.ts +25 -0
- package/src/components/chart/core/pane-settings.ts +82 -0
- package/src/components/chart/core/pointer.ts +292 -0
- package/src/components/chart/core/projection.ts +333 -0
- package/src/components/chart/core/render-utils.ts +4 -0
- package/src/components/chart/core/renderer.ts +249 -0
- package/src/components/chart/core/resolution.test.ts +99 -0
- package/src/components/chart/core/resolution.ts +380 -0
- package/src/components/chart/core/scene.ts +180 -0
- package/src/components/chart/core/scroll.test.ts +70 -0
- package/src/components/chart/core/scroll.ts +104 -0
- package/src/components/chart/core/time-axis.ts +330 -0
- package/src/components/chart/core/types.ts +124 -0
- package/src/components/chart/core/viewport.test.ts +29 -0
- package/src/components/chart/core/viewport.ts +51 -0
- package/src/components/chart/core/window-viewport.test.ts +69 -0
- package/src/components/chart/core/window-viewport.ts +162 -0
- package/src/components/chart/display-cursor.ts +153 -0
- package/src/components/chart/market-session.ts +1 -1
- package/src/components/chart/multi-line/renderer.test.ts +83 -0
- package/src/components/chart/multi-line/renderer.ts +160 -0
- package/src/components/chart/multi-line/scene.ts +188 -0
- package/src/components/chart/native/canvas-bitmaps.ts +140 -0
- package/src/components/chart/native/chart-rasterizer.ts +18 -865
- package/src/components/chart/native/kitty/adapter.ts +9 -0
- package/src/components/chart/native/kitty/index.test.ts +752 -0
- package/src/components/chart/native/kitty/manager.ts +142 -0
- package/src/components/chart/native/kitty/support.ts +70 -0
- package/src/components/chart/native/raster/comparison-chart.ts +162 -0
- package/src/components/chart/native/raster/crosshair.ts +51 -0
- package/src/components/chart/native/raster/layout.ts +136 -0
- package/src/components/chart/native/raster/placement.ts +132 -0
- package/src/components/chart/native/raster/price-chart.ts +244 -0
- package/src/components/chart/native/raster/primitives.ts +154 -0
- package/src/components/chart/native/raster/types.ts +41 -0
- package/src/components/chart/native/renderer-selection.ts +81 -1
- package/src/components/chart/native/surface/hooks.ts +137 -0
- package/src/components/chart/native/surface/manager.ts +225 -0
- package/src/components/chart/native/surface/rendering.ts +211 -0
- package/src/components/chart/native/surface/sync.ts +34 -0
- package/src/components/chart/native/surface/visibility.ts +48 -0
- package/src/components/chart/price-axis-labels.tsx +4 -4
- package/src/components/chart/rendering/chart-draw.ts +270 -0
- package/src/components/chart/rendering/geometry.ts +95 -0
- package/src/components/chart/rendering/pixel-buffer.ts +267 -0
- package/src/components/chart/scatter-chart-renderer.test.ts +31 -0
- package/src/components/chart/scatter-chart-renderer.ts +223 -0
- package/src/components/chart/static/bar-chart-surface.tsx +85 -0
- package/src/components/chart/static/chart/bitmap.ts +50 -0
- package/src/components/chart/static/chart/surface.test.tsx +51 -0
- package/src/components/chart/static/chart/surface.tsx +181 -0
- package/src/components/chart/static/multi-line-chart-surface.tsx +180 -0
- package/src/components/chart/static/scatter-chart-surface.tsx +83 -0
- package/src/components/chart/stock-chart/auto.ts +216 -0
- package/src/components/chart/stock-chart/axis-width.ts +146 -0
- package/src/components/chart/stock-chart/bitmaps.ts +22 -0
- package/src/components/chart/stock-chart/canvas.ts +202 -0
- package/src/components/chart/stock-chart/controls.tsx +149 -0
- package/src/components/chart/stock-chart/cursor.ts +60 -0
- package/src/components/chart/stock-chart/data-runtime.ts +129 -0
- package/src/components/chart/stock-chart/footer.ts +248 -0
- package/src/components/chart/stock-chart/geometry.ts +160 -0
- package/src/components/chart/stock-chart/index.test.ts +500 -0
- package/src/components/chart/stock-chart/index.tsx +29 -0
- package/src/components/chart/stock-chart/indicators.ts +226 -0
- package/src/components/chart/stock-chart/interaction-runtime.ts +44 -0
- package/src/components/chart/stock-chart/interactions.ts +300 -0
- package/src/components/chart/stock-chart/keyboard.ts +373 -0
- package/src/components/chart/stock-chart/layout-metrics.ts +62 -0
- package/src/components/chart/stock-chart/layout.tsx +177 -0
- package/src/components/chart/stock-chart/native-surfaces.ts +121 -0
- package/src/components/chart/stock-chart/presentation.ts +67 -0
- package/src/components/chart/stock-chart/renderer-switch.test.tsx +263 -0
- package/src/components/chart/stock-chart/rendering/bounds.ts +116 -0
- package/src/components/chart/stock-chart/rendering/candidates.ts +145 -0
- package/src/components/chart/stock-chart/rendering/data.ts +370 -0
- package/src/components/chart/stock-chart/rendering/invalidation.ts +68 -0
- package/src/components/chart/stock-chart/rendering/output.ts +304 -0
- package/src/components/chart/stock-chart/rendering/planning.ts +122 -0
- package/src/components/chart/stock-chart/rendering/projection.test.tsx +98 -0
- package/src/components/chart/stock-chart/rendering/projection.ts +112 -0
- package/src/components/chart/stock-chart/rendering/state.test.ts +70 -0
- package/src/components/chart/stock-chart/rendering/state.ts +283 -0
- package/src/components/chart/stock-chart/requests.ts +337 -0
- package/src/components/chart/stock-chart/resolution-support.ts +96 -0
- package/src/components/chart/stock-chart/resolved/runtime.ts +289 -0
- package/src/components/chart/stock-chart/resolved.tsx +345 -0
- package/src/components/chart/stock-chart/settings.ts +77 -0
- package/src/components/chart/stock-chart/surface-runtime.ts +62 -0
- package/src/components/chart/stock-chart/types.ts +25 -0
- package/src/components/chart/stock-chart/view.tsx +155 -0
- package/src/components/chart/stock-chart/viewport/effects.ts +296 -0
- package/src/components/chart/stock-chart/viewport/index.ts +144 -0
- package/src/components/chart/stock-chart/viewport/runtime.ts +375 -0
- package/src/components/chart/time-axis-label.tsx +4 -3
- package/src/components/command-bar/action-runtime.ts +326 -0
- package/src/components/command-bar/commands/collection.ts +214 -0
- package/src/components/command-bar/commands/direct/index.ts +266 -0
- package/src/components/command-bar/commands/direct/runtime.ts +168 -0
- package/src/components/command-bar/commands/plugin/actions.ts +171 -0
- package/src/components/command-bar/commands/plugin/items.ts +166 -0
- package/src/components/command-bar/commands/registry.ts +263 -0
- package/src/components/command-bar/helpers.test.ts +13 -21
- package/src/components/command-bar/helpers.ts +51 -272
- package/src/components/command-bar/keyboard-handlers.ts +306 -0
- package/src/components/command-bar/keyboard-shortcuts.ts +204 -0
- package/src/components/command-bar/layout-items/current-layout.ts +120 -0
- package/src/components/command-bar/layout-items/focused-pane.ts +143 -0
- package/src/components/command-bar/layout-items/types.ts +25 -0
- package/src/components/command-bar/layout-items/window-mode.ts +72 -0
- package/src/components/command-bar/layout-items.ts +93 -0
- package/src/components/command-bar/list/model.ts +81 -0
- package/src/components/command-bar/list/navigation.ts +125 -0
- package/src/components/command-bar/list/view.tsx +316 -0
- package/src/components/command-bar/multi-select-picker.tsx +219 -0
- package/src/components/command-bar/multi-select-runtime.ts +91 -0
- package/src/components/command-bar/pane-actions.ts +124 -0
- package/src/components/command-bar/pane-settings.ts +227 -0
- package/src/components/command-bar/pane-templates/items.ts +203 -0
- package/src/components/command-bar/pane-templates/workflow-route.ts +81 -0
- package/src/components/command-bar/pane-templates/workflow.ts +282 -0
- package/src/components/command-bar/panel/body.tsx +311 -0
- package/src/components/command-bar/panel/index.tsx +196 -0
- package/src/components/command-bar/panel/layout.ts +117 -0
- package/src/components/command-bar/panel/runtime.ts +280 -0
- package/src/components/command-bar/panel/state.ts +138 -0
- package/src/components/command-bar/panel/types.ts +78 -0
- package/src/components/command-bar/picker-activation.ts +126 -0
- package/src/components/command-bar/routes/root/command-items.ts +176 -0
- package/src/components/command-bar/routes/root/provider-search.ts +200 -0
- package/src/components/command-bar/routes/root/results.ts +233 -0
- package/src/components/command-bar/routes/root/runtime.ts +315 -0
- package/src/components/command-bar/routes/root/selection.ts +228 -0
- package/src/components/command-bar/routes/root/shortcut-feedback.ts +108 -0
- package/src/components/command-bar/routes/root/shortcut-items.ts +159 -0
- package/src/components/command-bar/routes/root/shortcuts.test.ts +151 -0
- package/src/components/command-bar/routes/root/shortcuts.ts +188 -0
- package/src/components/command-bar/routes/ticker-search/actions.ts +142 -0
- package/src/components/command-bar/routes/ticker-search/results.ts +94 -0
- package/src/components/command-bar/routes/ticker-search/route.ts +151 -0
- package/src/components/command-bar/routing/actions.ts +299 -0
- package/src/components/command-bar/routing/confirm.ts +91 -0
- package/src/components/command-bar/routing/effects.ts +82 -0
- package/src/components/command-bar/routing/launch-request.ts +59 -0
- package/src/components/command-bar/routing/list-state.ts +242 -0
- package/src/components/command-bar/routing/navigation-state.ts +147 -0
- package/src/components/command-bar/selection-runtime.ts +291 -0
- package/src/components/command-bar/surface/environment.ts +124 -0
- package/src/components/command-bar/surface/index.test.tsx +864 -0
- package/src/components/command-bar/surface/index.tsx +344 -0
- package/src/components/command-bar/surface/pane.test.tsx +703 -0
- package/src/components/command-bar/surface/portfolio.test.tsx +452 -0
- package/src/components/command-bar/surface/test-harness.tsx +403 -0
- package/src/components/command-bar/theme-preview.ts +84 -0
- package/src/components/command-bar/view-model.test.ts +3 -3
- package/src/components/command-bar/view-model.ts +7 -6
- package/src/components/command-bar/workflow/alert.ts +164 -0
- package/src/components/command-bar/workflow/body.tsx +179 -0
- package/src/components/command-bar/workflow/broker.ts +158 -0
- package/src/components/command-bar/workflow/builtin.ts +134 -0
- package/src/components/command-bar/workflow/collection-actions.ts +257 -0
- package/src/components/command-bar/workflow/coordinator.ts +193 -0
- package/src/components/command-bar/workflow/field-row.tsx +214 -0
- package/src/components/command-bar/workflow/fields.ts +230 -0
- package/src/components/command-bar/workflow/ops.test.ts +197 -0
- package/src/components/command-bar/workflow/ops.ts +268 -0
- package/src/components/command-bar/workflow/route-actions.ts +232 -0
- package/src/components/command-bar/workflow/route-builder.ts +56 -0
- package/src/components/command-bar/workflow/runtime.ts +234 -0
- package/src/components/command-bar/workflow/submit.ts +213 -0
- package/src/components/command-bar/workflow/tickers.ts +214 -0
- package/src/components/command-bar/workflow/types.ts +127 -0
- package/src/components/data-table/stack-view.test.tsx +218 -0
- package/src/components/data-table/stack-view.tsx +59 -0
- package/src/components/data-table/view.test.tsx +254 -0
- package/src/components/data-table/view.tsx +306 -0
- package/src/components/feed-data-table/stack-view.test.tsx +148 -0
- package/src/components/feed-data-table/stack-view.tsx +359 -0
- package/src/components/index.ts +14 -14
- package/src/components/input-search-bar.tsx +94 -0
- package/src/components/layout/detached-pane-shell.tsx +22 -16
- package/src/components/layout/floating-pane.tsx +19 -24
- package/src/components/layout/header.tsx +9 -21
- package/src/components/layout/pane/content.test.tsx +64 -0
- package/src/components/layout/pane/content.tsx +44 -0
- package/src/components/layout/pane/cycle-order.test.ts +30 -0
- package/src/components/layout/pane/cycle-order.ts +32 -0
- package/src/components/layout/pane/footer/index.test.tsx +131 -0
- package/src/components/layout/pane/footer/index.tsx +246 -0
- package/src/components/layout/pane/footer/model.ts +99 -0
- package/src/components/layout/pane/footer/registration.tsx +114 -0
- package/src/components/layout/pane/frame.tsx +55 -0
- package/src/components/layout/pane/header.test.tsx +39 -0
- package/src/components/layout/pane/header.tsx +252 -0
- package/src/components/layout/pane/index.tsx +105 -0
- package/src/components/layout/pane/keyboard-scroll.test.tsx +146 -0
- package/src/components/layout/pane/sizing.ts +66 -0
- package/src/components/layout/pane/title.ts +38 -0
- package/src/components/layout/shell/action-menu-overlay.tsx +72 -0
- package/src/components/layout/shell/active-drag.ts +221 -0
- package/src/components/layout/shell/chrome.ts +8 -0
- package/src/components/layout/shell/drag/index.ts +432 -0
- package/src/components/layout/shell/drag/overlays.tsx +78 -0
- package/src/components/layout/shell/drag/runtime.ts +264 -0
- package/src/components/layout/shell/index.test.tsx +788 -0
- package/src/components/layout/shell/index.tsx +451 -0
- package/src/components/layout/shell/layout-state.ts +97 -0
- package/src/components/layout/shell/menu.ts +152 -0
- package/src/components/layout/shell/native/pointer-runtime.ts +184 -0
- package/src/components/layout/shell/native/surfaces.ts +127 -0
- package/src/components/layout/shell/native/window-state.ts +208 -0
- package/src/components/layout/shell/pane/actions.ts +129 -0
- package/src/components/layout/shell/pane/layers.tsx +234 -0
- package/src/components/layout/shell/pane/management-shortcuts.ts +114 -0
- package/src/components/layout/shell/shortcuts.ts +47 -0
- package/src/components/layout/shell/terminal-pointer-runtime.ts +326 -0
- package/src/components/layout/shell/window-mode/index.ts +253 -0
- package/src/components/layout/shell/window-mode/overlays.tsx +208 -0
- package/src/components/layout/status-bar.test.tsx +1 -101
- package/src/components/layout/status-bar.tsx +1 -1
- package/src/components/layout/window-edit/mode.test.ts +55 -0
- package/src/components/layout/window-edit/mode.ts +422 -0
- package/src/components/layout/window-edit/presentation.ts +123 -0
- package/src/components/layout/window-edit/status.tsx +101 -0
- package/src/components/markdown-text.tsx +3 -3
- package/src/components/onboarding/onboarding-steps.tsx +248 -0
- package/src/components/onboarding/onboarding-wizard.tsx +97 -1035
- package/src/components/onboarding/portfolio-step/broker-fields-panel.tsx +144 -0
- package/src/components/onboarding/portfolio-step/broker-setup-panel.tsx +97 -0
- package/src/components/onboarding/portfolio-step/broker-sync-panel.tsx +42 -0
- package/src/components/onboarding/portfolio-step/choose-panel.tsx +42 -0
- package/src/components/onboarding/portfolio-step/index.tsx +70 -0
- package/src/components/onboarding/portfolio-step/manual-name-panel.tsx +62 -0
- package/src/components/onboarding/portfolio-step/types.ts +25 -0
- package/src/components/onboarding/portfolio-step/utils.ts +15 -0
- package/src/components/onboarding/wizard-broker-sync.ts +230 -0
- package/src/components/onboarding/wizard-keyboard.ts +264 -0
- package/src/components/onboarding/wizard-model.ts +21 -0
- package/src/components/pane-settings-dialog/desktop.tsx +315 -0
- package/src/components/pane-settings-dialog/field-dialogs.tsx +213 -0
- package/src/components/pane-settings-dialog/tui.tsx +73 -0
- package/src/components/pane-settings-dialog/value.ts +36 -0
- package/src/components/pane-settings-dialog.tsx +18 -622
- package/src/components/pane-template-wizard.tsx +1 -1
- package/src/components/price-selector-dialog.tsx +2 -2
- package/src/components/price-sparkline/bitmap.ts +150 -0
- package/src/components/price-sparkline/index.ts +46 -0
- package/src/components/price-sparkline/model.ts +119 -0
- package/src/components/price-sparkline/view.tsx +214 -0
- package/src/components/quote-flash.ts +103 -0
- package/src/components/speedometer-gauge/desktop.tsx +151 -0
- package/src/components/speedometer-gauge/index.tsx +44 -0
- package/src/components/speedometer-gauge/model.ts +60 -0
- package/src/components/speedometer-gauge/terminal.tsx +261 -0
- package/src/components/ticker/badge/format.ts +42 -0
- package/src/components/ticker/badge/index.tsx +100 -0
- package/src/components/ticker/badge/list.tsx +57 -0
- package/src/components/ticker/badge/text.test.tsx +223 -0
- package/src/components/ticker/badge/text.tsx +156 -0
- package/src/components/ticker/list-table-view.tsx +297 -0
- package/src/components/ticker/list-table.test.tsx +177 -0
- package/src/components/toggle-list.tsx +1 -1
- package/src/components/ui/data-table/index.tsx +26 -0
- package/src/components/ui/data-table/opentui/index.tsx +467 -0
- package/src/components/ui/data-table/opentui/model.test.ts +47 -0
- package/src/components/ui/data-table/opentui/model.ts +66 -0
- package/src/components/ui/data-table/types.ts +81 -0
- package/src/components/ui/index.ts +1 -3
- package/src/components/ui/multi-select/dialog.tsx +336 -0
- package/src/components/ui/native-select.tsx +1 -1
- package/src/components/ui/shortcut-hint.tsx +1 -1
- package/src/components/ui/tabs.tsx +11 -5
- package/src/components/ui/toggle.tsx +1 -1
- package/src/components/ui/ui.test.tsx +3 -75
- package/src/components/use-external-link-footer.ts +1 -1
- package/src/core/app-services.ts +3 -0
- package/src/core/state/app/layout-reducer.ts +196 -0
- package/src/core/state/app/layout.ts +406 -0
- package/src/core/state/app/state.ts +340 -0
- package/src/core/state/app/types.ts +116 -0
- package/src/core/state/session-persistence.ts +1 -1
- package/src/data/app-persistence.ts +1 -1
- package/src/data/config/layout.ts +227 -0
- package/src/data/config/store/index.test.ts +500 -0
- package/src/data/config/store/index.ts +64 -0
- package/src/data/config/store/node.ts +101 -0
- package/src/data/config/store/normalize.ts +403 -0
- package/src/data/plugin-state-store.ts +3 -3
- package/src/data/resource-store.ts +3 -3
- package/src/data/session-store.ts +3 -3
- package/src/data/sqlite/cache.test.ts +151 -0
- package/src/data/sqlite/database.ts +68 -0
- package/src/data/sqlite/json.ts +16 -0
- package/src/data/sqlite/retry.test.ts +63 -0
- package/src/data/ticker-repository.ts +1 -1
- package/src/data/ticker-store.ts +2 -2
- package/src/market-data/coordinator/auxiliary.ts +252 -0
- package/src/market-data/coordinator/chart.ts +141 -0
- package/src/market-data/coordinator/entries.ts +129 -0
- package/src/market-data/coordinator/events.ts +74 -0
- package/src/market-data/coordinator/financials.ts +281 -0
- package/src/market-data/coordinator/index.test.ts +840 -0
- package/src/market-data/coordinator/index.ts +388 -0
- package/src/market-data/coordinator/quotes.ts +329 -0
- package/src/market-data/coordinator/subscriptions.test.ts +209 -0
- package/src/market-data/hooks.test.tsx +42 -1
- package/src/market-data/hooks.tsx +83 -18
- package/src/market-data/market/format.test.ts +109 -0
- package/src/market-data/market/format.ts +293 -0
- package/src/market-data/market/freshness.ts +140 -0
- package/src/market-data/market/status.ts +112 -0
- package/src/market-data/quotes/contributions.ts +194 -0
- package/src/market-data/quotes/freshness.test.ts +150 -0
- package/src/market-data/quotes/freshness.ts +36 -0
- package/src/market-data/quotes/resolution.test.ts +277 -0
- package/src/market-data/quotes/resolution.ts +468 -0
- package/src/market-data/quotes/time.test.ts +34 -0
- package/src/market-data/quotes/time.ts +59 -0
- package/src/market-data/request-types.ts +10 -3
- package/src/market-data/result-types.ts +3 -3
- package/src/market-data/selectors.ts +2 -2
- package/src/news/aggregator.ts +29 -219
- package/src/news/news-model.ts +208 -0
- package/src/news/ticker-symbols.ts +1 -1
- package/src/news/types.ts +3 -3
- package/src/plugins/builtin/account-management/footer.ts +39 -0
- package/src/plugins/builtin/account-management/form-components.tsx +162 -0
- package/src/plugins/builtin/account-management/keyboard.ts +90 -0
- package/src/plugins/builtin/account-management/model.ts +97 -0
- package/src/plugins/builtin/account-management/pane.tsx +389 -0
- package/src/plugins/builtin/account-management/password-dialog.tsx +125 -0
- package/src/plugins/builtin/ai/ask-ai-detail-tab.tsx +6 -6
- package/src/plugins/builtin/ai/ask-ai.test.tsx +305 -0
- package/src/plugins/builtin/ai/index.tsx +4 -4
- package/src/plugins/builtin/ai/providers.ts +1 -1
- package/src/plugins/builtin/ai/runner.ts +1 -0
- package/src/plugins/builtin/ai/screener/action-bar.tsx +58 -0
- package/src/plugins/builtin/ai/screener/contract.test.ts +117 -0
- package/src/plugins/builtin/ai/screener/contract.ts +174 -0
- package/src/plugins/builtin/ai/screener/editor-runtime.ts +110 -0
- package/src/plugins/builtin/ai/screener/editor.tsx +125 -0
- package/src/plugins/builtin/ai/screener/footer.ts +93 -0
- package/src/plugins/builtin/ai/screener/keyboard.ts +90 -0
- package/src/plugins/builtin/ai/screener/market-runtime.ts +99 -0
- package/src/plugins/builtin/ai/screener/model.ts +107 -0
- package/src/plugins/builtin/ai/screener/pane.test.tsx +348 -0
- package/src/plugins/builtin/ai/screener/pane.tsx +412 -0
- package/src/plugins/builtin/ai/screener/results-view.tsx +169 -0
- package/src/plugins/builtin/ai/screener/results.ts +139 -0
- package/src/plugins/builtin/ai/screener/runner.ts +144 -0
- package/src/plugins/builtin/ai/screener/tabs-bar.tsx +65 -0
- package/src/plugins/builtin/ai/settings.ts +3 -3
- package/src/plugins/builtin/ai/ticker-context.ts +1 -1
- package/src/plugins/builtin/alerts/command.ts +86 -0
- package/src/plugins/builtin/alerts/constants.ts +3 -0
- package/src/plugins/builtin/alerts/format.ts +68 -0
- package/src/plugins/builtin/alerts/index.test.tsx +5 -4
- package/src/plugins/builtin/alerts/index.tsx +18 -473
- package/src/plugins/builtin/alerts/pane.tsx +304 -0
- package/src/plugins/builtin/alerts/quotes.ts +57 -0
- package/src/plugins/builtin/alerts/storage.ts +20 -0
- package/src/plugins/builtin/analytics/broker-performance.ts +142 -0
- package/src/plugins/builtin/analytics/display.ts +44 -0
- package/src/plugins/builtin/analytics/index.test.tsx +144 -5
- package/src/plugins/builtin/analytics/index.tsx +108 -468
- package/src/plugins/builtin/analytics/metrics.ts +1 -1
- package/src/plugins/builtin/analytics/pane-model.ts +297 -0
- package/src/plugins/builtin/analytics/portfolio-selection.ts +10 -0
- package/src/plugins/builtin/analytics/sector-model.ts +172 -0
- package/src/plugins/builtin/analytics/view.tsx +207 -0
- package/src/plugins/builtin/broker-manager/detail.tsx +232 -0
- package/src/plugins/builtin/broker-manager/footer.ts +62 -0
- package/src/plugins/builtin/broker-manager/index.test.tsx +3 -3
- package/src/plugins/builtin/broker-manager/index.tsx +125 -527
- package/src/plugins/builtin/broker-manager/keyboard.ts +104 -0
- package/src/plugins/builtin/broker-manager/model.test.ts +39 -1
- package/src/plugins/builtin/broker-manager/model.ts +14 -8
- package/src/plugins/builtin/broker-manager/pane-actions.tsx +181 -0
- package/src/plugins/builtin/broker-manager/table.ts +86 -0
- package/src/plugins/builtin/buildout/cells.tsx +203 -0
- package/src/plugins/builtin/buildout/data-runtime.ts +238 -0
- package/src/plugins/builtin/buildout/detail/company.tsx +219 -0
- package/src/plugins/builtin/buildout/detail/index.tsx +105 -0
- package/src/plugins/builtin/buildout/detail/intel.tsx +61 -0
- package/src/plugins/builtin/buildout/detail/satellite-images.tsx +80 -0
- package/src/plugins/builtin/buildout/detail/site.tsx +142 -0
- package/src/plugins/builtin/buildout/detail/ui.tsx +355 -0
- package/src/plugins/builtin/buildout/detail/values.ts +67 -0
- package/src/plugins/builtin/buildout/format.ts +163 -0
- package/src/plugins/builtin/buildout/model/index.ts +135 -0
- package/src/plugins/builtin/buildout/model/normalizers.ts +396 -0
- package/src/plugins/builtin/buildout/model/types.ts +318 -0
- package/src/plugins/builtin/buildout/pane/header.tsx +55 -0
- package/src/plugins/builtin/buildout/pane/index.tsx +405 -0
- package/src/plugins/builtin/buildout/pane/status.tsx +84 -0
- package/src/plugins/builtin/buildout/table-model.ts +367 -0
- package/src/plugins/builtin/changelog/index.tsx +370 -0
- package/src/plugins/builtin/chat/channels.ts +157 -0
- package/src/plugins/builtin/chat/chat.test.tsx +1048 -0
- package/src/plugins/builtin/chat/composer-commands.test.ts +30 -0
- package/src/plugins/builtin/chat/composer-commands.ts +34 -0
- package/src/plugins/builtin/chat/content/channel-navigation.ts +157 -0
- package/src/plugins/builtin/chat/content/composer-runtime.ts +251 -0
- package/src/plugins/builtin/chat/content/composer.tsx +148 -0
- package/src/plugins/builtin/chat/content/index.tsx +407 -0
- package/src/plugins/builtin/chat/content/layout-metrics.ts +72 -0
- package/src/plugins/builtin/chat/content/scroll.ts +278 -0
- package/src/plugins/builtin/chat/content/selection-runtime.ts +66 -0
- package/src/plugins/builtin/chat/content/shortcuts.ts +212 -0
- package/src/plugins/builtin/chat/content/snapshot.ts +154 -0
- package/src/plugins/builtin/chat/content/transcript.tsx +155 -0
- package/src/plugins/builtin/chat/content/types.ts +26 -0
- package/src/plugins/builtin/chat/content/user-map.ts +21 -0
- package/src/plugins/builtin/chat/controller/channel-actions.ts +87 -0
- package/src/plugins/builtin/chat/controller/channels.ts +159 -0
- package/src/plugins/builtin/chat/controller/connections.ts +90 -0
- package/src/plugins/builtin/chat/controller/draft-sync.ts +41 -0
- package/src/plugins/builtin/chat/controller/fetch.ts +83 -0
- package/src/plugins/builtin/chat/controller/index.ts +488 -0
- package/src/plugins/builtin/chat/controller/lifecycle.ts +141 -0
- package/src/plugins/builtin/chat/controller/message-loading.ts +97 -0
- package/src/plugins/builtin/chat/controller/messages.ts +173 -0
- package/src/plugins/builtin/chat/controller/notifications.ts +56 -0
- package/src/plugins/builtin/chat/controller/persistence.ts +166 -0
- package/src/plugins/builtin/chat/controller/realtime.ts +91 -0
- package/src/plugins/builtin/chat/controller/send.ts +89 -0
- package/src/plugins/builtin/chat/controller/session-runtime.ts +156 -0
- package/src/plugins/builtin/chat/controller/session.ts +39 -0
- package/src/plugins/builtin/chat/controller/state.ts +162 -0
- package/src/plugins/builtin/chat/controller/storage.ts +136 -0
- package/src/plugins/builtin/chat/controller/utils.ts +75 -0
- package/src/plugins/builtin/chat/controller/view.ts +96 -0
- package/src/plugins/builtin/chat/controller.test.ts +1302 -0
- package/src/plugins/builtin/chat/index.tsx +4 -0
- package/src/plugins/builtin/chat/layout.ts +330 -0
- package/src/plugins/builtin/chat/message/action-chip.tsx +38 -0
- package/src/plugins/builtin/chat/message/desktop.tsx +158 -0
- package/src/plugins/builtin/chat/message/inline-tokens.tsx +118 -0
- package/src/plugins/builtin/chat/message/profile-popover.tsx +72 -0
- package/src/plugins/builtin/chat/message/render-state.ts +67 -0
- package/src/plugins/builtin/chat/message/terminal.tsx +132 -0
- package/src/plugins/builtin/chat/message/types.ts +18 -0
- package/src/plugins/builtin/chat/pane.tsx +100 -0
- package/src/plugins/builtin/chat/profile-popover.ts +49 -0
- package/src/plugins/builtin/chat/sidebar.test.tsx +455 -0
- package/src/plugins/builtin/chat/sidebar.tsx +296 -0
- package/src/plugins/builtin/chat/status-widget.tsx +103 -0
- package/src/plugins/builtin/chat/test-harness.tsx +212 -0
- package/src/plugins/builtin/cloud/auth-actions.tsx +72 -0
- package/src/plugins/builtin/cloud/auth-commands.ts +115 -0
- package/src/plugins/builtin/cloud/index.tsx +11 -0
- package/src/plugins/builtin/cloud/plugin.tsx +185 -0
- package/src/plugins/builtin/cloud-tweets/footer.ts +40 -0
- package/src/plugins/builtin/cloud-tweets/index.ts +1 -0
- package/src/plugins/builtin/cloud-tweets/keyboard.ts +65 -0
- package/src/plugins/builtin/cloud-tweets/model.ts +257 -0
- package/src/plugins/builtin/cloud-tweets/pane.tsx +318 -0
- package/src/plugins/builtin/cloud-tweets/registration.ts +87 -0
- package/src/plugins/builtin/cloud-tweets/search-bar.tsx +49 -0
- package/src/plugins/builtin/cloud-tweets/table.tsx +331 -0
- package/src/plugins/builtin/comparison-chart/index.test.tsx +645 -0
- package/src/plugins/builtin/comparison-chart/index.tsx +194 -0
- package/src/plugins/builtin/congress-trades/detail.tsx +154 -0
- package/src/plugins/builtin/congress-trades/footer.ts +67 -0
- package/src/plugins/builtin/congress-trades/keyboard.ts +112 -0
- package/src/plugins/builtin/congress-trades/model.ts +224 -0
- package/src/plugins/builtin/congress-trades/pane.tsx +331 -0
- package/src/plugins/builtin/congress-trades/table.tsx +84 -0
- package/src/plugins/builtin/correlation/compute.ts +0 -7
- package/src/plugins/builtin/correlation/index.test.tsx +5 -5
- package/src/plugins/builtin/correlation/index.tsx +36 -208
- package/src/plugins/builtin/correlation/matrix/model.ts +155 -0
- package/src/plugins/builtin/correlation/matrix/symbol-cell.tsx +56 -0
- package/src/plugins/builtin/correlation/relationship/controls.tsx +53 -0
- package/src/plugins/builtin/correlation/relationship/history.ts +72 -0
- package/src/plugins/builtin/correlation/relationship/model.ts +279 -0
- package/src/plugins/builtin/correlation/relationship/pane.tsx +359 -0
- package/src/plugins/builtin/correlation/relationship/view-model.ts +120 -0
- package/src/plugins/builtin/correlation/settings.ts +6 -6
- package/src/plugins/builtin/debug/index.tsx +365 -0
- package/src/plugins/builtin/earnings/data/cache.test.ts +94 -0
- package/src/plugins/builtin/earnings/data/cache.ts +145 -0
- package/src/plugins/builtin/earnings/data/data.test.ts +90 -0
- package/src/plugins/builtin/earnings/data/data.ts +115 -0
- package/src/plugins/builtin/earnings/index.test.ts +12 -0
- package/src/plugins/builtin/earnings/index.tsx +74 -266
- package/src/plugins/builtin/earnings/model.ts +82 -0
- package/src/plugins/builtin/earnings/table.ts +206 -0
- package/src/plugins/builtin/econ/calendar-model.test.ts +48 -0
- package/src/plugins/builtin/econ/calendar-model.ts +217 -0
- package/src/plugins/builtin/econ/calendar-source.ts +1 -1
- package/src/plugins/builtin/econ/detail-view.tsx +319 -0
- package/src/plugins/builtin/econ/fred-cache.test.ts +58 -0
- package/src/plugins/builtin/econ/fred-cache.ts +106 -0
- package/src/plugins/builtin/econ/fred-series-map.ts +0 -4
- package/src/plugins/builtin/econ/index.tsx +46 -474
- package/src/plugins/builtin/fear-greed/cache.test.ts +75 -0
- package/src/plugins/builtin/fear-greed/cache.ts +142 -0
- package/src/plugins/builtin/fear-greed/charts.tsx +305 -0
- package/src/plugins/builtin/fear-greed/data.test.ts +72 -0
- package/src/plugins/builtin/fear-greed/data.ts +370 -0
- package/src/plugins/builtin/fear-greed/format.ts +96 -0
- package/src/plugins/builtin/fear-greed/index.tsx +13 -555
- package/src/plugins/builtin/fear-greed/pane.tsx +169 -0
- package/src/plugins/builtin/fx-matrix/index.tsx +1 -1
- package/src/plugins/builtin/fx-matrix/pairs.ts +0 -22
- package/src/plugins/builtin/help/components.tsx +92 -0
- package/src/plugins/builtin/help/index.test.tsx +167 -0
- package/src/plugins/builtin/help/index.tsx +256 -0
- package/src/plugins/builtin/help/shortcut-model.ts +145 -0
- package/src/plugins/builtin/holders/format.ts +44 -0
- package/src/plugins/builtin/holders/index.test.ts +2 -76
- package/src/plugins/builtin/holders/index.tsx +3 -959
- package/src/plugins/builtin/holders/pane.tsx +331 -0
- package/src/plugins/builtin/holders/table-model.ts +84 -0
- package/src/plugins/builtin/holders/thirteenf-match.ts +76 -0
- package/src/plugins/builtin/holders/treemap-layout.ts +231 -0
- package/src/plugins/builtin/holders/treemap.tsx +318 -0
- package/src/plugins/builtin/holders/types.ts +51 -0
- package/src/plugins/builtin/insider/index.tsx +5 -5
- package/src/plugins/builtin/layout-manager/index.tsx +247 -0
- package/src/plugins/builtin/market-movers/index.tsx +44 -282
- package/src/plugins/builtin/market-movers/model.ts +146 -0
- package/src/plugins/builtin/market-movers/screener.test.ts +31 -1
- package/src/plugins/builtin/market-movers/screener.ts +106 -12
- package/src/plugins/builtin/market-movers/table.ts +95 -0
- package/src/plugins/builtin/news/index.tsx +194 -0
- package/src/plugins/builtin/news/wire/breaking/notifications.test.ts +98 -0
- package/src/plugins/builtin/news/wire/breaking/notifications.ts +110 -0
- package/src/plugins/builtin/news/wire/breaking/pane.test.tsx +156 -0
- package/src/plugins/builtin/news/wire/breaking/pane.tsx +68 -0
- package/src/plugins/builtin/news/wire/categories.ts +114 -0
- package/src/plugins/builtin/news/wire/default-feeds.ts +3 -0
- package/src/plugins/builtin/news/wire/feed-config.test.ts +90 -0
- package/src/plugins/builtin/news/wire/feed-config.ts +216 -0
- package/src/plugins/builtin/news/wire/index.tsx +129 -0
- package/src/plugins/builtin/news/wire/industry-pane.tsx +126 -0
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +306 -0
- package/src/plugins/builtin/news/wire/news/footer.ts +77 -0
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +98 -0
- package/src/plugins/builtin/news/wire/news/query-presets.ts +40 -0
- package/src/plugins/builtin/news/wire/news/table.test.tsx +157 -0
- package/src/plugins/builtin/news/wire/news/table.tsx +270 -0
- package/src/plugins/builtin/news/wire/persisted-articles.ts +98 -0
- package/src/plugins/builtin/news/wire/read-state.ts +76 -0
- package/src/plugins/builtin/news/wire/rss/parser.test.ts +116 -0
- package/src/plugins/builtin/news/wire/rss/parser.ts +213 -0
- package/src/plugins/builtin/news/wire/rss/source.test.ts +104 -0
- package/src/plugins/builtin/news/wire/rss/source.ts +181 -0
- package/src/plugins/builtin/notes/index.tsx +49 -0
- package/src/plugins/builtin/notes/markdown-note-preview.tsx +39 -0
- package/src/plugins/builtin/notes/model.ts +36 -0
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +334 -0
- package/src/plugins/builtin/notes/text-state.ts +11 -0
- package/src/plugins/builtin/notes/ticker-notes-tab.tsx +112 -0
- package/src/plugins/builtin/options/index.tsx +44 -0
- package/src/plugins/builtin/options/table.ts +209 -0
- package/src/plugins/builtin/options/types.ts +33 -0
- package/src/plugins/builtin/options/view.test.tsx +185 -0
- package/src/plugins/builtin/options/view.tsx +264 -0
- package/src/plugins/builtin/plugin-groups.ts +25 -5
- package/src/plugins/builtin/portfolio-list/account-metrics.test.ts +50 -0
- package/src/plugins/builtin/portfolio-list/account-metrics.ts +46 -0
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +224 -0
- package/src/plugins/builtin/portfolio-list/cli/render.ts +203 -0
- package/src/plugins/builtin/portfolio-list/cli/shared.ts +21 -0
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +224 -0
- package/src/plugins/builtin/portfolio-list/column-values.ts +284 -0
- package/src/plugins/builtin/portfolio-list/command-bar.ts +1 -1
- package/src/plugins/builtin/portfolio-list/header.tsx +7 -98
- package/src/plugins/builtin/portfolio-list/index.test.ts +133 -0
- package/src/plugins/builtin/portfolio-list/index.tsx +2 -1
- package/src/plugins/builtin/portfolio-list/metrics.test.ts +242 -0
- package/src/plugins/builtin/portfolio-list/metrics.ts +5 -462
- package/src/plugins/builtin/portfolio-list/pane/data.ts +171 -0
- package/src/plugins/builtin/portfolio-list/pane/index.test.tsx +1267 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +385 -0
- package/src/plugins/builtin/portfolio-list/pane/streaming.ts +159 -0
- package/src/plugins/builtin/portfolio-list/position-metrics.ts +123 -0
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +326 -0
- package/src/plugins/builtin/portfolio-list/quick-add/resolution.ts +135 -0
- package/src/plugins/builtin/portfolio-list/settings.ts +5 -3
- package/src/plugins/builtin/portfolio-list/summary/index.test.ts +126 -0
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +392 -0
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +86 -0
- package/src/plugins/builtin/portfolio-list/table.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/use-throttled-cursor-symbol.ts +1 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +383 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +413 -0
- package/src/plugins/builtin/research/index.test.ts +248 -2
- package/src/plugins/builtin/research/index.tsx +30 -760
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +189 -0
- package/src/plugins/builtin/sec/filing-display.tsx +84 -0
- package/src/plugins/builtin/sec/index.tsx +342 -0
- package/src/plugins/builtin/sectors/index.tsx +27 -234
- package/src/plugins/builtin/sectors/sector-data.ts +0 -2
- package/src/plugins/builtin/sectors/sector-model.ts +221 -0
- package/src/plugins/builtin/shared/table-pane.ts +31 -0
- package/src/plugins/builtin/shared/ticker-request.ts +70 -0
- package/src/plugins/builtin/shared/ticker-surface.test.ts +57 -0
- package/src/plugins/builtin/shared/ticker-surface.ts +113 -0
- package/src/plugins/builtin/thirteenf/api.test.ts +58 -0
- package/src/plugins/builtin/thirteenf/api.ts +375 -0
- package/src/plugins/builtin/thirteenf/data.test.ts +95 -0
- package/src/plugins/builtin/thirteenf/data.ts +210 -0
- package/src/plugins/builtin/thirteenf/format.ts +55 -0
- package/src/plugins/builtin/thirteenf/index.tsx +80 -0
- package/src/plugins/builtin/thirteenf/model.test.ts +156 -0
- package/src/plugins/builtin/thirteenf/model.ts +618 -0
- package/src/plugins/builtin/thirteenf/pane.test.tsx +328 -0
- package/src/plugins/builtin/thirteenf/pane.tsx +826 -0
- package/src/plugins/builtin/thirteenf/table.ts +212 -0
- package/src/plugins/builtin/thirteenf/types.ts +187 -0
- package/src/plugins/builtin/ticker-detail/chart-pane.tsx +91 -0
- package/src/plugins/builtin/ticker-detail/chart-tab-switch.test.tsx +282 -0
- package/src/plugins/builtin/ticker-detail/chart-tab.tsx +3 -5
- package/src/plugins/builtin/ticker-detail/data-panes/fundamental-graph/content.tsx +158 -0
- package/src/plugins/builtin/ticker-detail/data-panes/fundamental-graph/data.ts +62 -0
- package/src/plugins/builtin/ticker-detail/data-panes/fundamental-graph/model.ts +234 -0
- package/src/plugins/builtin/ticker-detail/data-panes/fundamental-graph/settings.ts +44 -0
- package/src/plugins/builtin/ticker-detail/data-panes/fundamental-graph/types.ts +51 -0
- package/src/plugins/builtin/ticker-detail/data-panes/fundamental-graph.tsx +135 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +192 -0
- package/src/plugins/builtin/ticker-detail/data-panes/provider-search.tsx +172 -0
- package/src/plugins/builtin/ticker-detail/data-panes.test.ts +110 -0
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +203 -0
- package/src/plugins/builtin/ticker-detail/financials/model.test.ts +84 -0
- package/src/plugins/builtin/ticker-detail/financials/model.ts +364 -0
- package/src/plugins/builtin/ticker-detail/financials/pane.tsx +27 -0
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +392 -0
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +438 -0
- package/src/plugins/builtin/ticker-detail/index.test.tsx +780 -0
- package/src/plugins/builtin/ticker-detail/index.tsx +174 -17
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +240 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +168 -0
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +14 -0
- package/src/plugins/builtin/ticker-detail/overview/types.ts +17 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +27 -392
- package/src/plugins/builtin/ticker-detail/pane.tsx +24 -136
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +330 -0
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.test.tsx +292 -0
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +180 -0
- package/src/plugins/builtin/ticker-detail/settings.ts +39 -33
- package/src/plugins/builtin/world-indices/footer.ts +28 -0
- package/src/plugins/builtin/world-indices/index.tsx +25 -218
- package/src/plugins/builtin/world-indices/model.ts +120 -0
- package/src/plugins/builtin/world-indices/table.tsx +96 -0
- package/src/plugins/builtin/yahoo/index.ts +72 -0
- package/src/plugins/builtin/yield-curve/index.tsx +5 -5
- package/src/plugins/builtin/yield-curve/treasury-data.ts +1 -1
- package/src/plugins/catalog-ui.ts +7 -9
- package/src/plugins/catalog.ts +1 -1
- package/src/plugins/ibkr/account-cache.ts +2 -10
- package/src/plugins/ibkr/broker-adapter.ts +10 -4
- package/src/plugins/ibkr/config.ts +5 -24
- package/src/plugins/ibkr/dialogs.tsx +0 -1
- package/src/plugins/ibkr/flex/index.test.ts +236 -0
- package/src/plugins/ibkr/flex/index.ts +337 -0
- package/src/plugins/ibkr/flex/statement-client.ts +181 -0
- package/src/plugins/ibkr/gateway/account-loaders.ts +266 -0
- package/src/plugins/ibkr/gateway/account-summary.ts +163 -0
- package/src/plugins/ibkr/gateway/client-lock.ts +154 -0
- package/src/plugins/ibkr/gateway/connection-events.ts +114 -0
- package/src/plugins/ibkr/gateway/connection.ts +152 -0
- package/src/plugins/ibkr/gateway/contracts.ts +132 -0
- package/src/plugins/ibkr/gateway/fundamentals.ts +83 -0
- package/src/plugins/ibkr/gateway/helpers.ts +33 -0
- package/src/plugins/ibkr/gateway/history-requests.ts +158 -0
- package/src/plugins/ibkr/gateway/history.ts +120 -0
- package/src/plugins/ibkr/gateway/instrument-lookup.ts +117 -0
- package/src/plugins/ibkr/gateway/market-data.ts +338 -0
- package/src/plugins/ibkr/gateway/order-execution.ts +218 -0
- package/src/plugins/ibkr/gateway/orders.ts +63 -0
- package/src/plugins/ibkr/gateway/price-normalization.test.ts +44 -0
- package/src/plugins/ibkr/gateway/price-normalization.ts +50 -0
- package/src/plugins/ibkr/gateway/quote-stream-controller.ts +203 -0
- package/src/plugins/ibkr/gateway/quote-stream.ts +171 -0
- package/src/plugins/ibkr/gateway/selection.ts +51 -0
- package/src/plugins/ibkr/gateway/service/index.test.ts +614 -0
- package/src/plugins/ibkr/gateway/service/index.ts +432 -0
- package/src/plugins/ibkr/gateway/service/lifecycle.ts +191 -0
- package/src/plugins/ibkr/gateway/service/manager.ts +52 -0
- package/src/plugins/ibkr/gateway/service/market-data.ts +48 -0
- package/src/plugins/ibkr/gateway/service/native.ts +543 -0
- package/src/plugins/ibkr/gateway/timeouts.ts +13 -0
- package/src/plugins/ibkr/gateway/types.ts +27 -0
- package/src/plugins/ibkr/hash.ts +8 -0
- package/src/plugins/ibkr/index.test.tsx +1 -12
- package/src/plugins/ibkr/index.tsx +8 -9
- package/src/plugins/ibkr/instance-selection.test.ts +2 -2
- package/src/plugins/ibkr/instance-selection.ts +1 -1
- package/src/plugins/ibkr/portfolio-performance.test.ts +32 -0
- package/src/plugins/ibkr/portfolio-performance.ts +129 -0
- package/src/plugins/ibkr/trade/badge.tsx +28 -0
- package/src/plugins/ibkr/trade/dialogs.tsx +44 -0
- package/src/plugins/ibkr/trade/preview-panel.tsx +130 -0
- package/src/plugins/ibkr/trade/tab/actions.tsx +443 -0
- package/src/plugins/ibkr/trade/tab/field-editors.tsx +79 -0
- package/src/plugins/ibkr/trade/tab/footer.ts +67 -0
- package/src/plugins/ibkr/trade/tab/header.tsx +167 -0
- package/src/plugins/ibkr/trade/tab/index.test.tsx +178 -0
- package/src/plugins/ibkr/trade/tab/index.tsx +302 -0
- package/src/plugins/ibkr/trade/tab/model.ts +159 -0
- package/src/plugins/ibkr/trade/tab/order-request.ts +64 -0
- package/src/plugins/ibkr/trade/tab/shortcuts.ts +89 -0
- package/src/plugins/ibkr/trade/tab/state-sync.ts +86 -0
- package/src/plugins/ibkr/trade/ticket-panel.tsx +301 -0
- package/src/plugins/ibkr/trade/utils.test.ts +175 -0
- package/src/plugins/ibkr/trade/utils.ts +150 -0
- package/src/plugins/ibkr/trading/pane-view.tsx +175 -0
- package/src/plugins/ibkr/trading/pane.tsx +332 -0
- package/src/plugins/ibkr/trading/state.test.ts +109 -0
- package/src/plugins/ibkr/trading/state.ts +335 -0
- package/src/plugins/pane-manager/dock-tree.ts +282 -0
- package/src/plugins/pane-manager/docking.ts +202 -0
- package/src/plugins/pane-manager/floating-actions.ts +158 -0
- package/src/plugins/pane-manager/floating.ts +76 -0
- package/src/plugins/pane-manager/gridlock-inference.ts +126 -0
- package/src/plugins/pane-manager/gridlock.ts +34 -0
- package/src/plugins/pane-manager/layout-state.ts +160 -0
- package/src/plugins/pane-manager/queries.ts +75 -0
- package/src/plugins/pane-manager/types.ts +24 -0
- package/src/plugins/pane-manager.test.ts +79 -4
- package/src/plugins/pane-manager.ts +57 -1061
- package/src/plugins/prediction-markets/chart.test.tsx +2 -2
- package/src/plugins/prediction-markets/controller/catalog.ts +317 -0
- package/src/plugins/prediction-markets/controller/data.ts +171 -0
- package/src/plugins/prediction-markets/controller/detail.ts +243 -0
- package/src/plugins/prediction-markets/controller/effects.ts +253 -0
- package/src/plugins/prediction-markets/controller/index.ts +374 -0
- package/src/plugins/prediction-markets/controller/keyboard.ts +220 -0
- package/src/plugins/prediction-markets/controller/live-updates.ts +85 -0
- package/src/plugins/prediction-markets/controller/selection.ts +59 -0
- package/src/plugins/prediction-markets/controller/status.ts +104 -0
- package/src/plugins/prediction-markets/detail/outcomes.tsx +1 -1
- package/src/plugins/prediction-markets/metrics.ts +4 -14
- package/src/plugins/prediction-markets/navigation.ts +0 -13
- package/src/plugins/prediction-markets/pane.test.tsx +2 -198
- package/src/plugins/prediction-markets/plugin.test.tsx +2 -2
- package/src/plugins/prediction-markets/services/fetch.ts +1 -5
- package/src/plugins/prediction-markets/services/kalshi/adapter.ts +299 -0
- package/src/plugins/prediction-markets/services/kalshi/normalize.ts +209 -0
- package/src/plugins/prediction-markets/services/kalshi/types.ts +89 -0
- package/src/plugins/prediction-markets/services/polymarket/adapter.ts +134 -0
- package/src/plugins/prediction-markets/services/polymarket/detail.ts +307 -0
- package/src/plugins/prediction-markets/services/polymarket/normalize.ts +239 -0
- package/src/plugins/prediction-markets/services/polymarket/types.ts +66 -0
- package/src/plugins/prediction-markets/services/polymarket/ws.ts +128 -0
- package/src/plugins/prediction-markets/test-helpers.tsx +12 -76
- package/src/plugins/prediction-markets/types.ts +2 -2
- package/src/plugins/registry/context-menu.ts +36 -0
- package/src/plugins/registry/context.ts +196 -0
- package/src/plugins/registry/contributions.ts +174 -0
- package/src/plugins/registry/index.test.ts +362 -0
- package/src/plugins/registry/index.ts +474 -0
- package/src/plugins/registry/pane-settings.ts +105 -0
- package/src/plugins/registry/plugin-state.ts +123 -0
- package/src/plugins/registry/shared.ts +34 -0
- package/src/plugins/registry/slots.ts +70 -0
- package/src/plugins/runtime/context.tsx +115 -0
- package/src/plugins/runtime/index.test.tsx +328 -0
- package/src/plugins/runtime/index.tsx +111 -0
- package/src/plugins/runtime/state.ts +275 -0
- package/src/plugins/ticker-navigation.test.ts +23 -2
- package/src/plugins/ticker-navigation.ts +9 -3
- package/src/react/input.test.ts +29 -0
- package/src/react/input.ts +9 -0
- package/src/renderers/electrobun/bun/application-menu/click.test.ts +50 -0
- package/src/renderers/electrobun/bun/application-menu/click.ts +58 -0
- package/src/renderers/electrobun/bun/application-menu/index.ts +123 -0
- package/src/renderers/electrobun/bun/context-menu/click.test.ts +67 -0
- package/src/renderers/electrobun/bun/context-menu/normalize.test.ts +52 -0
- package/src/renderers/electrobun/bun/context-menu/normalize.ts +67 -0
- package/src/renderers/electrobun/bun/core-capabilities.ts +3 -0
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +163 -0
- package/src/renderers/electrobun/bun/desktop/capability-bridge.ts +93 -0
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +263 -0
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +114 -0
- package/src/renderers/electrobun/bun/desktop/http-fetch.ts +56 -0
- package/src/renderers/electrobun/bun/desktop/initialization.ts +139 -0
- package/src/renderers/electrobun/bun/desktop/plugin-state.ts +92 -0
- package/src/renderers/electrobun/bun/desktop/relaunch.ts +48 -0
- package/src/renderers/electrobun/bun/desktop/rpc-registry.ts +43 -0
- package/src/renderers/electrobun/bun/desktop/state-broadcaster.ts +76 -0
- package/src/renderers/electrobun/bun/desktop/update.ts +162 -0
- package/src/renderers/electrobun/bun/desktop/window-events.ts +49 -0
- package/src/renderers/electrobun/bun/desktop/workspace/index.test.ts +63 -0
- package/src/renderers/electrobun/bun/desktop/workspace/index.ts +180 -0
- package/src/renderers/electrobun/bun/desktop/workspace/requests.ts +97 -0
- package/src/renderers/electrobun/bun/index.ts +165 -1001
- package/src/renderers/electrobun/bun/tui-entry.ts +6 -0
- package/src/renderers/electrobun/bun/window/focus.ts +37 -0
- package/src/renderers/electrobun/bun/window/frame.test.ts +40 -0
- package/src/renderers/electrobun/shared/protocol.ts +1 -1
- package/src/renderers/electrobun/view/app-services.ts +4 -375
- package/src/renderers/electrobun/view/build-assets.ts +117 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +398 -0
- package/src/renderers/electrobun/view/config-host.ts +1 -1
- package/src/renderers/electrobun/view/context-menu.test.ts +10 -4
- package/src/renderers/electrobun/view/context-menu.ts +1 -1
- package/src/renderers/electrobun/view/data-table/dom.ts +211 -0
- package/src/renderers/electrobun/view/data-table/index.tsx +358 -0
- package/src/renderers/electrobun/view/data-table/row.tsx +335 -0
- package/src/renderers/electrobun/view/desktop/control-styles.ts +77 -0
- package/src/renderers/electrobun/view/desktop/controls.tsx +421 -0
- package/src/renderers/electrobun/view/desktop/list-view.tsx +200 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +70 -0
- package/src/renderers/electrobun/view/desktop/window/snapshot.test.ts +57 -0
- package/src/renderers/electrobun/view/desktop/window/snapshot.ts +41 -0
- package/src/renderers/electrobun/view/fatal-screen.tsx +2 -2
- package/src/renderers/electrobun/view/host/box.tsx +160 -0
- package/src/renderers/electrobun/view/host/chart-surface.tsx +142 -0
- package/src/renderers/electrobun/view/host/input.tsx +294 -0
- package/src/renderers/electrobun/view/host/mouse.ts +139 -0
- package/src/renderers/electrobun/view/host/native.ts +49 -0
- package/src/renderers/electrobun/view/host/scroll-box.tsx +276 -0
- package/src/renderers/electrobun/view/host/style.ts +124 -0
- package/src/renderers/electrobun/view/host/tabs.tsx +255 -0
- package/src/renderers/electrobun/view/host/text.tsx +121 -0
- package/src/renderers/electrobun/view/http-fetch.ts +1 -1
- package/src/renderers/electrobun/view/input-host.tsx +12 -1
- package/src/renderers/electrobun/view/main.tsx +8 -3
- package/src/renderers/electrobun/view/native-stubs/backend-rpc.ts +59 -0
- package/src/renderers/electrobun/view/native-stubs/chart/kitty-support.ts +9 -0
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +201 -0
- package/src/renderers/electrobun/view/remote/persistence.ts +158 -0
- package/src/renderers/electrobun/view/remote/ticker-repository.ts +26 -0
- package/src/renderers/electrobun/view/styles.css +43 -0
- package/src/renderers/electrobun/view/ui-host.tsx +22 -1469
- package/src/renderers/opentui/chart-surface.tsx +4 -5
- package/src/renderers/opentui/host.tsx +30 -4
- package/src/renderers/opentui/image/loader.test.ts +25 -0
- package/src/renderers/opentui/image/loader.ts +105 -0
- package/src/renderers/opentui/image/surface.tsx +266 -0
- package/src/renderers/opentui/input-host.tsx +12 -1
- package/src/renderers/opentui/start.tsx +2 -2
- package/src/renderers/opentui/test-utils.tsx +2 -2
- package/src/renderers/opentui/ui-host.tsx +1 -1
- package/src/sources/gloomberb-cloud/index.test.ts +660 -0
- package/src/sources/gloomberb-cloud/index.ts +444 -0
- package/src/sources/gloomberb-cloud/news.ts +127 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +354 -0
- package/src/sources/provider-errors.ts +8 -2
- package/src/sources/provider-router/batches.ts +170 -0
- package/src/sources/provider-router/brokers.ts +114 -0
- package/src/sources/provider-router/cache.ts +171 -0
- package/src/sources/provider-router/cached-financials.test.ts +498 -0
- package/src/sources/provider-router/document-routes.ts +153 -0
- package/src/sources/provider-router/financial-routes.ts +225 -0
- package/src/sources/provider-router/financials.ts +259 -0
- package/src/sources/provider-router/history.test.ts +383 -0
- package/src/sources/provider-router/history.ts +448 -0
- package/src/sources/provider-router/index.test.ts +1438 -0
- package/src/sources/provider-router/index.ts +389 -0
- package/src/sources/provider-router/news.ts +36 -0
- package/src/sources/provider-router/primary.ts +164 -0
- package/src/sources/provider-router/route-types.ts +34 -0
- package/src/sources/provider-router/routing.ts +58 -0
- package/src/sources/provider-router/search.ts +183 -0
- package/src/sources/provider-router/sources.ts +55 -0
- package/src/sources/provider-router/streaming.ts +92 -0
- package/src/sources/provider-router/supplemental.ts +373 -0
- package/src/sources/provider-router/test-support.ts +136 -0
- package/src/sources/sec-edgar/content.ts +211 -0
- package/src/sources/sec-edgar.ts +9 -217
- package/src/sources/yahoo-finance/financials.ts +339 -0
- package/src/sources/yahoo-finance/history.ts +106 -0
- package/src/sources/yahoo-finance/http.ts +100 -0
- package/src/sources/yahoo-finance/mappers.ts +409 -0
- package/src/sources/yahoo-finance/options.ts +134 -0
- package/src/sources/yahoo-finance/quote-summary.ts +210 -0
- package/src/sources/yahoo-finance/requests.ts +192 -0
- package/src/sources/yahoo-finance/snapshots.ts +236 -0
- package/src/sources/yahoo-finance/symbols.ts +102 -0
- package/src/sources/yahoo-finance/types.ts +167 -0
- package/src/sources/yahoo-finance.test.ts +116 -12
- package/src/sources/yahoo-finance.ts +115 -1408
- package/src/state/app/activity.test.ts +41 -0
- package/src/state/app/activity.ts +106 -0
- package/src/state/app/bootstrap.test.ts +498 -0
- package/src/state/app/bootstrap.ts +412 -0
- package/src/state/app/context/index.test.ts +564 -0
- package/src/state/app/context/index.test.tsx +193 -0
- package/src/state/app/context/index.tsx +476 -0
- package/src/state/app/context/selector.test.tsx +291 -0
- package/src/state/config-save-scheduler.ts +2 -6
- package/src/state/hooks/inline-tickers.test.tsx +123 -0
- package/src/state/hooks/inline-tickers.ts +212 -0
- package/src/state/hooks/quote-streaming.test.ts +31 -0
- package/src/state/hooks/quote-streaming.test.tsx +70 -0
- package/src/state/hooks/quote-streaming.ts +92 -0
- package/src/state/hooks/session-snapshot.ts +99 -0
- package/src/state/pane-scroll-registry.tsx +1 -1
- package/src/state/selectors-ui.ts +1 -1
- package/src/state/selectors.ts +1 -1
- package/src/test-support/plugin-persistence.ts +112 -0
- package/src/test-support/plugin-runtime.ts +2 -1
- package/src/theme/colors.ts +23 -9
- package/src/theme/themes.test.ts +15 -0
- package/src/tickers/list.test.ts +16 -0
- package/src/tickers/open-target.ts +77 -0
- package/src/tickers/search/index.test.ts +252 -0
- package/src/tickers/search/index.ts +367 -0
- package/src/tickers/search/ranking.ts +387 -0
- package/src/tickers/search/result.ts +27 -0
- package/src/tickers/search/types.ts +41 -0
- package/src/tickers/search/upsert.ts +91 -0
- package/src/tickers/tokenizer.test.ts +31 -0
- package/src/tickers/tokenizer.ts +37 -0
- package/src/types/broker.ts +12 -4
- package/src/types/config.ts +42 -23
- package/src/types/context-menu.ts +1 -1
- package/src/types/data-provider.ts +2 -2
- package/src/types/desktop-window.ts +1 -1
- package/src/types/financials.ts +109 -4
- package/src/types/news-source.ts +0 -1
- package/src/types/persistence.ts +1 -1
- package/src/types/plugin.ts +37 -21
- package/src/types/ticker.ts +1 -0
- package/src/types/trading.ts +23 -1
- package/src/ui/context-menu.tsx +6 -5
- package/src/ui/dialog.tsx +6 -3
- package/src/ui/host.tsx +10 -10
- package/src/ui/index.tsx +14 -33
- package/src/updater/github-releases.test.ts +41 -0
- package/src/updater/github-releases.ts +73 -0
- package/src/updater.test.ts +21 -0
- package/src/updater.ts +10 -3
- package/src/utils/back-navigation.ts +2 -2
- package/src/utils/cli-output.ts +4 -4
- package/src/utils/currency-units.test.ts +23 -1
- package/src/utils/currency-units.ts +56 -0
- package/src/utils/datetime-format.ts +40 -0
- package/src/utils/dom-screenshot.ts +2 -2
- package/src/utils/double-escape-close.ts +1 -1
- package/src/utils/exchanges.ts +2 -2
- package/src/utils/format.ts +0 -7
- package/src/utils/fuzzy-search.ts +1 -1
- package/src/utils/inline-content-tokenizer.test.ts +11 -2
- package/src/utils/inline-content-tokenizer.ts +33 -12
- package/src/utils/keyboard.ts +1 -1
- package/src/utils/link-tokenizer.ts +2 -2
- package/src/utils/options.ts +1 -1
- package/src/utils/price-history.test.ts +20 -0
- package/src/utils/price-history.ts +24 -2
- package/src/utils/relative-time.ts +8 -0
- package/src/utils/selection-clipboard.ts +1 -1
- package/src/utils/shortcut-labels.ts +2 -2
- package/src/utils/sort-values.ts +17 -0
- package/src/utils/terminal-input-reset.ts +1 -1
- package/src/utils/text-wrap.ts +20 -0
- package/src/version.ts +1 -1
- package/src/components/chart/chart-controller.test.ts +0 -110
- package/src/components/chart/chart-controller.ts +0 -650
- package/src/components/chart/chart-data.ts +0 -350
- package/src/components/chart/chart-indicator-selector.tsx +0 -75
- package/src/components/chart/chart-pane-settings.ts +0 -37
- package/src/components/chart/chart-renderer.ts +0 -1562
- package/src/components/chart/chart-resolution.test.ts +0 -87
- package/src/components/chart/chart-resolution.ts +0 -405
- package/src/components/chart/chart-scroll.test.ts +0 -70
- package/src/components/chart/chart-scroll.ts +0 -104
- package/src/components/chart/chart-types.ts +0 -119
- package/src/components/chart/chart-viewport.test.ts +0 -29
- package/src/components/chart/chart-viewport.ts +0 -50
- package/src/components/chart/chart.test.ts +0 -922
- package/src/components/chart/comparison-chart-data.test.ts +0 -105
- package/src/components/chart/comparison-chart-data.ts +0 -292
- package/src/components/chart/comparison-chart-renderer.test.ts +0 -187
- package/src/components/chart/comparison-chart-renderer.ts +0 -437
- package/src/components/chart/native/kitty-adapter.ts +0 -9
- package/src/components/chart/native/kitty-manager.ts +0 -142
- package/src/components/chart/native/kitty-support.ts +0 -71
- package/src/components/chart/native/kitty.test.ts +0 -728
- package/src/components/chart/native/surface-manager.ts +0 -225
- package/src/components/chart/native/surface-sync.ts +0 -34
- package/src/components/chart/native/surface-visibility.ts +0 -48
- package/src/components/chart/static-chart-surface.test.tsx +0 -51
- package/src/components/chart/static-chart-surface.tsx +0 -217
- package/src/components/chart/stock-chart-renderer-switch.test.tsx +0 -1323
- package/src/components/chart/stock-chart.test.ts +0 -330
- package/src/components/chart/stock-chart.tsx +0 -4148
- package/src/components/command-bar/__snapshots__/command-bar.test.tsx.snap +0 -109
- package/src/components/command-bar/command-bar.test.tsx +0 -3244
- package/src/components/command-bar/command-bar.tsx +0 -5886
- package/src/components/command-bar/command-registry.ts +0 -267
- package/src/components/command-bar/confirm-body.tsx +0 -51
- package/src/components/command-bar/list-model.ts +0 -80
- package/src/components/command-bar/pane-template-display.ts +0 -8
- package/src/components/command-bar/root-shortcuts.ts +0 -188
- package/src/components/command-bar/workflow-ops.test.ts +0 -144
- package/src/components/command-bar/workflow-ops.ts +0 -459
- package/src/components/command-bar/workflow-types.ts +0 -127
- package/src/components/data-table-stack-view.test.tsx +0 -241
- package/src/components/data-table-stack-view.tsx +0 -59
- package/src/components/data-table-view.test.tsx +0 -211
- package/src/components/data-table-view.tsx +0 -244
- package/src/components/feed-data-table-stack-view.test.tsx +0 -225
- package/src/components/feed-data-table-stack-view.tsx +0 -359
- package/src/components/layout/pane-content.test.tsx +0 -64
- package/src/components/layout/pane-content.tsx +0 -44
- package/src/components/layout/pane-cycle-order.test.ts +0 -30
- package/src/components/layout/pane-cycle-order.ts +0 -32
- package/src/components/layout/pane-footer.test.tsx +0 -195
- package/src/components/layout/pane-footer.tsx +0 -432
- package/src/components/layout/pane-header.test.tsx +0 -39
- package/src/components/layout/pane-header.tsx +0 -248
- package/src/components/layout/pane-keyboard-scroll.test.tsx +0 -226
- package/src/components/layout/pane-sizing.ts +0 -34
- package/src/components/layout/pane-title.ts +0 -38
- package/src/components/layout/pane.tsx +0 -129
- package/src/components/layout/shell.test.tsx +0 -1453
- package/src/components/layout/shell.tsx +0 -1960
- package/src/components/price-sparkline-view.tsx +0 -463
- package/src/components/price-sparkline.ts +0 -46
- package/src/components/speedometer-gauge.test.tsx +0 -45
- package/src/components/speedometer-gauge.tsx +0 -562
- package/src/components/ticker-badge-list.tsx +0 -53
- package/src/components/ticker-badge-text.test.tsx +0 -253
- package/src/components/ticker-badge-text.tsx +0 -113
- package/src/components/ticker-badge.tsx +0 -109
- package/src/components/ticker-list-table-view.tsx +0 -233
- package/src/components/ticker-list-table.test.tsx +0 -210
- package/src/components/ticker-list-table.tsx +0 -458
- package/src/components/ui/data-table.tsx +0 -522
- package/src/components/ui/multi-select-dialog.tsx +0 -336
- package/src/core/state/app-state.ts +0 -1009
- package/src/data/config-layout.ts +0 -225
- package/src/data/config-store-node.ts +0 -478
- package/src/data/config-store.test.ts +0 -481
- package/src/data/config-store.ts +0 -64
- package/src/data/sqlite-cache.test.ts +0 -151
- package/src/data/sqlite-database.ts +0 -68
- package/src/data/sqlite-json.ts +0 -16
- package/src/data/sqlite-retry.test.ts +0 -63
- package/src/market-data/coordinator-subscriptions.test.ts +0 -209
- package/src/market-data/coordinator.test.ts +0 -830
- package/src/market-data/coordinator.ts +0 -1155
- package/src/plugins/builtin/ai/screener-contract.test.ts +0 -117
- package/src/plugins/builtin/ai/screener-contract.ts +0 -174
- package/src/plugins/builtin/ai/screener-pane.test.tsx +0 -348
- package/src/plugins/builtin/ai/screener-pane.tsx +0 -1118
- package/src/plugins/builtin/ai/utils.ts +0 -1
- package/src/plugins/builtin/ask-ai.test.tsx +0 -348
- package/src/plugins/builtin/chat-controller.test.ts +0 -1376
- package/src/plugins/builtin/chat-controller.ts +0 -1248
- package/src/plugins/builtin/chat.test.tsx +0 -2245
- package/src/plugins/builtin/chat.tsx +0 -2267
- package/src/plugins/builtin/cloud-auth-actions.tsx +0 -72
- package/src/plugins/builtin/cloud-tweets.tsx +0 -896
- package/src/plugins/builtin/comparison-chart.test.tsx +0 -532
- package/src/plugins/builtin/comparison-chart.tsx +0 -194
- package/src/plugins/builtin/debug.tsx +0 -365
- package/src/plugins/builtin/earnings/earnings-cache.test.ts +0 -181
- package/src/plugins/builtin/earnings/earnings-cache.ts +0 -145
- package/src/plugins/builtin/earnings/earnings-data.test.ts +0 -90
- package/src/plugins/builtin/earnings/earnings-data.ts +0 -115
- package/src/plugins/builtin/fear-greed/fear-greed-data.test.ts +0 -72
- package/src/plugins/builtin/fear-greed/fear-greed-data.ts +0 -366
- package/src/plugins/builtin/help.test.tsx +0 -166
- package/src/plugins/builtin/help.tsx +0 -450
- package/src/plugins/builtin/layout-manager.tsx +0 -247
- package/src/plugins/builtin/manual-entry.tsx +0 -25
- package/src/plugins/builtin/news-wire/breaking-notifications.test.ts +0 -98
- package/src/plugins/builtin/news-wire/breaking-notifications.ts +0 -110
- package/src/plugins/builtin/news-wire/breaking-pane.test.tsx +0 -156
- package/src/plugins/builtin/news-wire/breaking-pane.tsx +0 -68
- package/src/plugins/builtin/news-wire/categories.ts +0 -114
- package/src/plugins/builtin/news-wire/default-feeds.ts +0 -3
- package/src/plugins/builtin/news-wire/feed-config.test.ts +0 -90
- package/src/plugins/builtin/news-wire/feed-config.ts +0 -216
- package/src/plugins/builtin/news-wire/index.tsx +0 -129
- package/src/plugins/builtin/news-wire/industry-pane.tsx +0 -126
- package/src/plugins/builtin/news-wire/news-detail-view.tsx +0 -299
- package/src/plugins/builtin/news-wire/news-footer.ts +0 -28
- package/src/plugins/builtin/news-wire/news-preset-pane.tsx +0 -98
- package/src/plugins/builtin/news-wire/news-query-presets.ts +0 -40
- package/src/plugins/builtin/news-wire/news-table.test.tsx +0 -206
- package/src/plugins/builtin/news-wire/news-table.tsx +0 -296
- package/src/plugins/builtin/news-wire/persisted-articles.ts +0 -98
- package/src/plugins/builtin/news-wire/read-state.ts +0 -76
- package/src/plugins/builtin/news-wire/rss-parser.test.ts +0 -184
- package/src/plugins/builtin/news-wire/rss-parser.ts +0 -213
- package/src/plugins/builtin/news-wire/rss-source.test.ts +0 -159
- package/src/plugins/builtin/news-wire/rss-source.ts +0 -181
- package/src/plugins/builtin/news.tsx +0 -194
- package/src/plugins/builtin/notes.tsx +0 -561
- package/src/plugins/builtin/options.test.tsx +0 -241
- package/src/plugins/builtin/options.tsx +0 -542
- package/src/plugins/builtin/portfolio-list/cli/commands.ts +0 -657
- package/src/plugins/builtin/portfolio-list/pane.tsx +0 -724
- package/src/plugins/builtin/portfolio-list/quick-add.tsx +0 -422
- package/src/plugins/builtin/portfolio-list/summary.tsx +0 -275
- package/src/plugins/builtin/portfolio-list.test.ts +0 -133
- package/src/plugins/builtin/portfolio-list.test.tsx +0 -1535
- package/src/plugins/builtin/portfolio-metrics.test.ts +0 -236
- package/src/plugins/builtin/quote-monitor.test.tsx +0 -222
- package/src/plugins/builtin/sec-filing-display.tsx +0 -84
- package/src/plugins/builtin/sec.tsx +0 -342
- package/src/plugins/builtin/ticker-detail/financials-tab.tsx +0 -461
- package/src/plugins/builtin/ticker-detail/quote-monitor.tsx +0 -479
- package/src/plugins/builtin/ticker-detail-chart-tab-switch.test.tsx +0 -269
- package/src/plugins/builtin/ticker-detail.test.tsx +0 -888
- package/src/plugins/builtin/ticker-surface.ts +0 -68
- package/src/plugins/builtin/yahoo.ts +0 -72
- package/src/plugins/catalog-ui.test.ts +0 -24
- package/src/plugins/ibkr/__snapshots__/trade-tab.test.tsx.snap +0 -35
- package/src/plugins/ibkr/flex.test.ts +0 -162
- package/src/plugins/ibkr/flex.ts +0 -371
- package/src/plugins/ibkr/gateway-helpers.ts +0 -33
- package/src/plugins/ibkr/gateway-selection.ts +0 -51
- package/src/plugins/ibkr/gateway-service-native.ts +0 -2377
- package/src/plugins/ibkr/gateway-service.test.ts +0 -584
- package/src/plugins/ibkr/gateway-service.ts +0 -433
- package/src/plugins/ibkr/gateway-types.ts +0 -27
- package/src/plugins/ibkr/price-normalization.test.ts +0 -33
- package/src/plugins/ibkr/price-normalization.ts +0 -60
- package/src/plugins/ibkr/trade-badge.tsx +0 -28
- package/src/plugins/ibkr/trade-tab.test.tsx +0 -276
- package/src/plugins/ibkr/trade-tab.tsx +0 -1117
- package/src/plugins/ibkr/trade-utils.test.ts +0 -175
- package/src/plugins/ibkr/trade-utils.ts +0 -150
- package/src/plugins/ibkr/trading-pane.tsx +0 -474
- package/src/plugins/ibkr/trading-state.test.ts +0 -109
- package/src/plugins/ibkr/trading-state.ts +0 -339
- package/src/plugins/plugin-runtime.test.tsx +0 -323
- package/src/plugins/plugin-runtime.tsx +0 -433
- package/src/plugins/prediction-markets/controller-data.ts +0 -785
- package/src/plugins/prediction-markets/controller.ts +0 -659
- package/src/plugins/prediction-markets/services/kalshi-adapter.ts +0 -572
- package/src/plugins/prediction-markets/services/polymarket-adapter.ts +0 -696
- package/src/plugins/prediction-markets/services/polymarket-ws.ts +0 -128
- package/src/plugins/registry.test.ts +0 -362
- package/src/plugins/registry.ts +0 -854
- package/src/renderers/electrobun/bun/application-menu-click.test.ts +0 -50
- package/src/renderers/electrobun/bun/application-menu-click.ts +0 -58
- package/src/renderers/electrobun/bun/application-menu.ts +0 -123
- package/src/renderers/electrobun/bun/context-menu-click.test.ts +0 -67
- package/src/renderers/electrobun/bun/context-menu-normalize.test.ts +0 -52
- package/src/renderers/electrobun/bun/context-menu-normalize.ts +0 -67
- package/src/renderers/electrobun/bun/desktop-workspace.test.ts +0 -63
- package/src/renderers/electrobun/bun/desktop-workspace.ts +0 -180
- package/src/renderers/electrobun/bun/window-focus.ts +0 -37
- package/src/renderers/electrobun/bun/window-frame.test.ts +0 -40
- package/src/renderers/electrobun/view/data-table.tsx +0 -810
- package/src/renderers/electrobun/view/desktop-controls.tsx +0 -673
- package/src/renderers/electrobun/view/desktop-window-bridge.ts +0 -70
- package/src/renderers/electrobun/view/desktop-window-snapshot.test.ts +0 -57
- package/src/renderers/electrobun/view/desktop-window-snapshot.ts +0 -41
- package/src/renderers/electrobun/view/native-stubs/chart-kitty-support.ts +0 -9
- package/src/renderers/opentui/image-loader.test.ts +0 -25
- package/src/renderers/opentui/image-loader.ts +0 -105
- package/src/renderers/opentui/image-surface.tsx +0 -266
- package/src/sources/gloomberb-cloud.test.ts +0 -637
- package/src/sources/gloomberb-cloud.ts +0 -828
- package/src/sources/provider-router.test.ts +0 -2600
- package/src/sources/provider-router.ts +0 -2231
- package/src/state/app-activity.test.ts +0 -41
- package/src/state/app-activity.ts +0 -106
- package/src/state/app-bootstrap.test.ts +0 -498
- package/src/state/app-bootstrap.ts +0 -411
- package/src/state/app-context-selector.test.tsx +0 -369
- package/src/state/app-context.test.ts +0 -670
- package/src/state/app-context.test.tsx +0 -193
- package/src/state/app-context.tsx +0 -485
- package/src/state/use-inline-tickers.test.tsx +0 -73
- package/src/state/use-inline-tickers.ts +0 -188
- package/src/state/use-quote-streaming.test.ts +0 -31
- package/src/state/use-quote-streaming.test.tsx +0 -70
- package/src/state/use-quote-streaming.ts +0 -92
- package/src/state/use-session-snapshot.ts +0 -99
- package/src/utils/api-client.test.ts +0 -603
- package/src/utils/api-client.ts +0 -1379
- package/src/utils/market-format.test.ts +0 -109
- package/src/utils/market-format.ts +0 -299
- package/src/utils/market-status.ts +0 -141
- package/src/utils/quote-freshness.test.ts +0 -150
- package/src/utils/quote-freshness.ts +0 -145
- package/src/utils/quote-resolution.test.ts +0 -277
- package/src/utils/quote-resolution.ts +0 -642
- package/src/utils/quote-time.test.ts +0 -34
- package/src/utils/quote-time.ts +0 -59
- package/src/utils/ticker-list.test.ts +0 -16
- package/src/utils/ticker-search.test.ts +0 -227
- package/src/utils/ticker-search.ts +0 -926
- package/src/utils/ticker-tokenizer.test.ts +0 -31
- package/src/utils/ticker-tokenizer.ts +0 -37
- /package/src/components/chart/native/{kitty-protocol.ts → kitty/protocol.ts} +0 -0
- /package/src/components/ui/{multi-select.ts → multi-select/index.ts} +0 -0
- /package/src/data/{sqlite-retry.ts → sqlite/retry.ts} +0 -0
- /package/src/plugins/builtin/{news-wire → news/wire}/hash.ts +0 -0
- /package/src/plugins/builtin/{news-wire → news/wire}/read-state.test.ts +0 -0
- /package/src/plugins/builtin/{notes-files.ts → notes/files.ts} +0 -0
- /package/src/renderers/electrobun/bun/{context-menu-click.ts → context-menu/click.ts} +0 -0
- /package/src/renderers/electrobun/bun/{window-frame.ts → window/frame.ts} +0 -0
- /package/src/renderers/electrobun/view/native-stubs/{chart-surface-manager.ts → chart/surface-manager.ts} +0 -0
- /package/src/renderers/electrobun/view/native-stubs/{chart-surface-sync.ts → chart/surface-sync.ts} +0 -0
- /package/src/{utils/ticker-list.ts → tickers/list.ts} +0 -0
- /package/src/{utils/ticker-metadata.ts → tickers/metadata.ts} +0 -0
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { TextAttributes } from "../../ui";
|
|
5
|
-
import { type InputRenderable } from "../../ui";
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { Box, Text, type InputRenderable } from "../../ui";
|
|
3
|
+
import { useViewport } from "../../react/input";
|
|
6
4
|
import { colors, applyTheme } from "../../theme/colors";
|
|
7
|
-
import {
|
|
8
|
-
import { saveConfig } from "../../data/config-store";
|
|
5
|
+
import { getThemeIds } from "../../theme/themes";
|
|
9
6
|
import type { AppConfig } from "../../types/config";
|
|
10
7
|
import type { PluginRegistry } from "../../plugins/registry";
|
|
11
|
-
import { resolveBrokerConfigFields, type
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
import { resolveBrokerConfigFields, type BrokerConfigField } from "../../types/broker";
|
|
9
|
+
import type { ListViewItem } from "../ui";
|
|
10
|
+
import {
|
|
11
|
+
PortfolioStep,
|
|
12
|
+
ReadyStep,
|
|
13
|
+
ShortcutsStep,
|
|
14
|
+
ThemeStep,
|
|
15
|
+
WelcomeStep,
|
|
16
|
+
type PortfolioSub,
|
|
17
|
+
} from "./onboarding-steps";
|
|
18
|
+
import { finishOnboarding, summarizeOnboardingError, useOnboardingBrokerSync } from "./wizard-broker-sync";
|
|
19
|
+
import { useOnboardingKeyboard } from "./wizard-keyboard";
|
|
20
|
+
import {
|
|
21
|
+
getConnectableBrokerOptions,
|
|
22
|
+
ONBOARDING_STEPS,
|
|
23
|
+
type BrokerOption,
|
|
24
|
+
type OnboardingStep,
|
|
25
|
+
} from "./wizard-model";
|
|
20
26
|
|
|
21
27
|
interface OnboardingWizardProps {
|
|
22
28
|
config: AppConfig;
|
|
@@ -24,106 +30,30 @@ interface OnboardingWizardProps {
|
|
|
24
30
|
onComplete: (config: AppConfig) => void | Promise<void>;
|
|
25
31
|
}
|
|
26
32
|
|
|
27
|
-
type Step = "welcome" | "theme" | "portfolio" | "shortcuts" | "ready";
|
|
28
|
-
const STEPS: Step[] = ["welcome", "theme", "portfolio", "shortcuts", "ready"];
|
|
29
|
-
|
|
30
|
-
// Sub-steps within the portfolio step
|
|
31
|
-
type PortfolioSub = "choose" | "manual-name" | "broker-setup" | "broker-fields" | "broker-sync";
|
|
32
|
-
|
|
33
|
-
interface BrokerOption {
|
|
34
|
-
id: string;
|
|
35
|
-
name: string;
|
|
36
|
-
adapter: BrokerAdapter;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const LOGO_TEXT = "Gloomberb";
|
|
40
|
-
|
|
41
|
-
const PASSWORD_MASK_CHAR = "*";
|
|
42
|
-
const onboardingLog = debugLog.createLogger("onboarding");
|
|
43
|
-
|
|
44
|
-
interface BrokerSyncSummary {
|
|
45
|
-
portfolioId: string | null;
|
|
46
|
-
positionsImported: number;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function summarizeError(error: unknown): string {
|
|
50
|
-
if (error instanceof Error && error.message.trim()) {
|
|
51
|
-
return error.message.trim();
|
|
52
|
-
}
|
|
53
|
-
return "Unable to finish onboarding.";
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function focusPortfolioListCollection(config: AppConfig, collectionId: string): AppConfig {
|
|
57
|
-
const nextInstances = config.layout.instances.map((instance) => {
|
|
58
|
-
if (instance.paneId !== "portfolio-list") {
|
|
59
|
-
return instance;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const visibleCollectionIds = Array.isArray(instance.settings?.visibleCollectionIds)
|
|
63
|
-
? instance.settings.visibleCollectionIds.filter((value): value is string => typeof value === "string")
|
|
64
|
-
: [];
|
|
65
|
-
|
|
66
|
-
return {
|
|
67
|
-
...instance,
|
|
68
|
-
params: {
|
|
69
|
-
...instance.params,
|
|
70
|
-
collectionId,
|
|
71
|
-
},
|
|
72
|
-
settings: {
|
|
73
|
-
...instance.settings,
|
|
74
|
-
visibleCollectionIds: [collectionId, ...visibleCollectionIds.filter((value) => value !== collectionId)],
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
...config,
|
|
81
|
-
layout: {
|
|
82
|
-
...config.layout,
|
|
83
|
-
instances: nextInstances,
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
33
|
export function OnboardingWizard({ config, pluginRegistry, onComplete }: OnboardingWizardProps) {
|
|
89
34
|
const { width: termWidth, height: termHeight } = useViewport();
|
|
90
|
-
const [step, setStep] = useState<
|
|
35
|
+
const [step, setStep] = useState<OnboardingStep>("welcome");
|
|
91
36
|
const [themeIdx, setThemeIdx] = useState(0);
|
|
92
|
-
|
|
93
|
-
// Portfolio state
|
|
94
37
|
const [portfolioSub, setPortfolioSub] = useState<PortfolioSub>("choose");
|
|
95
38
|
const [portfolioOptionIdx, setPortfolioOptionIdx] = useState(0);
|
|
96
39
|
const [portfolioName, setPortfolioName] = useState("Main Portfolio");
|
|
97
|
-
// Broker credentials: brokerId -> { field_key -> value }
|
|
98
40
|
const [brokerValues, setBrokerValues] = useState<Record<string, Record<string, string>>>({});
|
|
99
41
|
const [selectedBrokerId, setSelectedBrokerId] = useState<string | null>(null);
|
|
100
42
|
const [brokerFieldIdx, setBrokerFieldIdx] = useState(0);
|
|
101
43
|
const [brokerSelectIdx, setBrokerSelectIdx] = useState(0);
|
|
102
44
|
const [editingField, setEditingField] = useState(false);
|
|
103
|
-
const [isBrokerSyncing, setIsBrokerSyncing] = useState(false);
|
|
104
|
-
const [brokerSyncError, setBrokerSyncError] = useState<string | null>(null);
|
|
105
|
-
const [brokerSyncedConfig, setBrokerSyncedConfig] = useState<AppConfig | null>(null);
|
|
106
|
-
const [brokerSyncSummary, setBrokerSyncSummary] = useState<BrokerSyncSummary | null>(null);
|
|
107
45
|
const [isFinishing, setIsFinishing] = useState(false);
|
|
108
46
|
const [finishError, setFinishError] = useState<string | null>(null);
|
|
109
47
|
|
|
110
48
|
const inputRef = useRef<InputRenderable>(null);
|
|
111
|
-
const brokerSyncAttemptRef = useRef(0);
|
|
112
49
|
const themeIds = getThemeIds();
|
|
113
|
-
const stepIdx =
|
|
50
|
+
const stepIdx = ONBOARDING_STEPS.indexOf(step);
|
|
114
51
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (adapter.configSchema.length > 0) {
|
|
120
|
-
options.push({ id, name: adapter.name, adapter });
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return options;
|
|
124
|
-
}, [pluginRegistry.brokers]);
|
|
52
|
+
const brokerOptions = useMemo(
|
|
53
|
+
(): BrokerOption[] => getConnectableBrokerOptions(pluginRegistry.brokers),
|
|
54
|
+
[pluginRegistry.brokers],
|
|
55
|
+
);
|
|
125
56
|
|
|
126
|
-
// Build the list of choices for the portfolio step: manual + all connectable brokers
|
|
127
57
|
const portfolioChoices = useMemo<ListViewItem[]>(() => {
|
|
128
58
|
const choices: ListViewItem[] = [
|
|
129
59
|
{ id: "manual", label: "Create Manual Portfolio", description: "Add tickers and positions by hand" },
|
|
@@ -138,21 +68,18 @@ export function OnboardingWizard({ config, pluginRegistry, onComplete }: Onboard
|
|
|
138
68
|
return choices;
|
|
139
69
|
}, [brokerOptions]);
|
|
140
70
|
|
|
141
|
-
// Get the currently selected broker's required fields
|
|
142
71
|
const activeBrokerFields = useMemo((): BrokerConfigField[] => {
|
|
143
72
|
if (!selectedBrokerId) return [];
|
|
144
|
-
const broker = brokerOptions.find((
|
|
73
|
+
const broker = brokerOptions.find((option) => option.id === selectedBrokerId);
|
|
145
74
|
return broker
|
|
146
75
|
? resolveBrokerConfigFields(broker.adapter, brokerValues[selectedBrokerId] ?? {}).filter((field) => field.required)
|
|
147
76
|
: [];
|
|
148
77
|
}, [selectedBrokerId, brokerOptions, brokerValues]);
|
|
149
78
|
|
|
150
|
-
// Apply theme preview synchronously so colors are correct for this render
|
|
151
79
|
if (step === "theme") {
|
|
152
80
|
applyTheme(themeIds[themeIdx]!);
|
|
153
81
|
}
|
|
154
82
|
|
|
155
|
-
// Focus input when entering editing mode
|
|
156
83
|
useEffect(() => {
|
|
157
84
|
if (editingField) {
|
|
158
85
|
setTimeout(() => inputRef.current?.focus(), 10);
|
|
@@ -175,130 +102,39 @@ export function OnboardingWizard({ config, pluginRegistry, onComplete }: Onboard
|
|
|
175
102
|
}, [finishError, step]);
|
|
176
103
|
|
|
177
104
|
const nextStep = useCallback(() => {
|
|
178
|
-
const idx =
|
|
179
|
-
if (idx <
|
|
105
|
+
const idx = ONBOARDING_STEPS.indexOf(step);
|
|
106
|
+
if (idx < ONBOARDING_STEPS.length - 1) {
|
|
180
107
|
setEditingField(false);
|
|
181
|
-
setStep(
|
|
108
|
+
setStep(ONBOARDING_STEPS[idx + 1]!);
|
|
182
109
|
}
|
|
183
110
|
}, [step]);
|
|
184
111
|
|
|
185
112
|
const prevStep = useCallback(() => {
|
|
186
|
-
const idx =
|
|
113
|
+
const idx = ONBOARDING_STEPS.indexOf(step);
|
|
187
114
|
if (idx > 0) {
|
|
188
|
-
setStep(
|
|
115
|
+
setStep(ONBOARDING_STEPS[idx - 1]!);
|
|
189
116
|
}
|
|
190
117
|
}, [step]);
|
|
191
118
|
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
throw new Error("Broker setup is incomplete.");
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
const brokerOption = brokerOptions.find((option) => option.id === selectedBrokerId);
|
|
207
|
-
const adapter = brokerOption?.adapter;
|
|
208
|
-
if (!adapter) throw new Error(`Unknown broker "${selectedBrokerId}".`);
|
|
209
|
-
const validationError = validateBrokerProfileValues(adapter, selectedValues);
|
|
210
|
-
if (validationError) throw new Error(validationError);
|
|
211
|
-
|
|
212
|
-
const label = brokerOption?.name || selectedBrokerId;
|
|
213
|
-
const brokerConfig = buildBrokerProfileConfig(adapter, selectedValues);
|
|
214
|
-
const instanceId = createBrokerInstanceId(
|
|
215
|
-
selectedBrokerId,
|
|
216
|
-
label,
|
|
217
|
-
config.brokerInstances.map((instance) => instance.id),
|
|
218
|
-
);
|
|
219
|
-
|
|
220
|
-
return {
|
|
221
|
-
instanceId,
|
|
222
|
-
config: {
|
|
223
|
-
...config,
|
|
224
|
-
brokerInstances: [
|
|
225
|
-
...config.brokerInstances,
|
|
226
|
-
{
|
|
227
|
-
id: instanceId,
|
|
228
|
-
brokerType: selectedBrokerId,
|
|
229
|
-
label,
|
|
230
|
-
connectionMode: typeof brokerConfig.connectionMode === "string" ? brokerConfig.connectionMode : undefined,
|
|
231
|
-
config: brokerConfig,
|
|
232
|
-
enabled: true,
|
|
233
|
-
},
|
|
234
|
-
],
|
|
235
|
-
} satisfies AppConfig,
|
|
236
|
-
};
|
|
237
|
-
}, [brokerOptions, brokerValues, config, selectedBrokerId]);
|
|
238
|
-
|
|
239
|
-
const syncSelectedBroker = useCallback(async (brokerValueOverrides?: Record<string, string>) => {
|
|
240
|
-
const attemptId = brokerSyncAttemptRef.current + 1;
|
|
241
|
-
brokerSyncAttemptRef.current = attemptId;
|
|
242
|
-
setEditingField(false);
|
|
243
|
-
setPortfolioSub("broker-sync");
|
|
244
|
-
setIsBrokerSyncing(true);
|
|
245
|
-
setBrokerSyncError(null);
|
|
246
|
-
setBrokerSyncedConfig(null);
|
|
247
|
-
setBrokerSyncSummary(null);
|
|
248
|
-
|
|
249
|
-
try {
|
|
250
|
-
const { config: draftConfig, instanceId } = buildDraftBrokerConfig(brokerValueOverrides);
|
|
251
|
-
onboardingLog.info("Syncing broker during onboarding", { instanceId, brokerId: selectedBrokerId });
|
|
252
|
-
const result = await syncBrokerInstance({
|
|
253
|
-
config: draftConfig,
|
|
254
|
-
instanceId,
|
|
255
|
-
brokers: pluginRegistry.brokers,
|
|
256
|
-
tickerRepository: pluginRegistry.tickerRepository,
|
|
257
|
-
resources: pluginRegistry.persistence.resources,
|
|
258
|
-
persistResolvedBrokerConfig: true,
|
|
259
|
-
});
|
|
260
|
-
if (brokerSyncAttemptRef.current !== attemptId) {
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
const portfolioId = result.portfolioIds[0] ?? null;
|
|
265
|
-
const nextConfig = portfolioId
|
|
266
|
-
? focusPortfolioListCollection(result.config, portfolioId)
|
|
267
|
-
: result.config;
|
|
268
|
-
setBrokerSyncedConfig(nextConfig);
|
|
269
|
-
setBrokerSyncSummary({
|
|
270
|
-
portfolioId,
|
|
271
|
-
positionsImported: result.positions.length,
|
|
272
|
-
});
|
|
273
|
-
setBrokerSyncError(null);
|
|
274
|
-
setIsBrokerSyncing(false);
|
|
275
|
-
setPortfolioSub("broker-fields");
|
|
276
|
-
onboardingLog.info("Broker onboarding sync completed", {
|
|
277
|
-
instanceId,
|
|
278
|
-
portfolioId,
|
|
279
|
-
positionsImported: result.positions.length,
|
|
280
|
-
});
|
|
281
|
-
nextStep();
|
|
282
|
-
} catch (error) {
|
|
283
|
-
if (brokerSyncAttemptRef.current !== attemptId) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
onboardingLog.error("Broker onboarding sync failed", { error: summarizeError(error), brokerId: selectedBrokerId });
|
|
288
|
-
setBrokerSyncError(summarizeError(error));
|
|
289
|
-
setIsBrokerSyncing(false);
|
|
290
|
-
setPortfolioSub("broker-sync");
|
|
291
|
-
}
|
|
292
|
-
}, [
|
|
293
|
-
buildDraftBrokerConfig,
|
|
294
|
-
nextStep,
|
|
295
|
-
pluginRegistry.brokers,
|
|
296
|
-
pluginRegistry.persistence.resources,
|
|
297
|
-
pluginRegistry.tickerRepository,
|
|
119
|
+
const {
|
|
120
|
+
isBrokerSyncing,
|
|
121
|
+
brokerSyncError,
|
|
122
|
+
brokerSyncedConfig,
|
|
123
|
+
brokerSyncSummary,
|
|
124
|
+
resetBrokerSync,
|
|
125
|
+
syncSelectedBroker,
|
|
126
|
+
} = useOnboardingBrokerSync({
|
|
127
|
+
config,
|
|
128
|
+
brokerOptions,
|
|
129
|
+
brokerValues,
|
|
298
130
|
selectedBrokerId,
|
|
299
|
-
|
|
131
|
+
pluginRegistry,
|
|
132
|
+
nextStep,
|
|
133
|
+
setEditingField,
|
|
134
|
+
setPortfolioSub,
|
|
135
|
+
});
|
|
300
136
|
|
|
301
|
-
const finish = useCallback(
|
|
137
|
+
const finish = useCallback(() => {
|
|
302
138
|
if (isFinishing) {
|
|
303
139
|
return;
|
|
304
140
|
}
|
|
@@ -307,31 +143,21 @@ export function OnboardingWizard({ config, pluginRegistry, onComplete }: Onboard
|
|
|
307
143
|
const selectedTheme = themeIds[themeIdx]!;
|
|
308
144
|
applyTheme(selectedTheme);
|
|
309
145
|
|
|
310
|
-
const isBroker = selectedBrokerId && selectedBrokerId !== "manual";
|
|
146
|
+
const isBroker = Boolean(selectedBrokerId && selectedBrokerId !== "manual");
|
|
311
147
|
const baseConfig = isBroker ? brokerSyncedConfig : config;
|
|
312
148
|
|
|
313
149
|
setIsFinishing(true);
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
? (baseConfig ?? config).portfolios
|
|
324
|
-
: [{ id: "main", name: portfolioName || "Main Portfolio", currency: "USD" }],
|
|
325
|
-
disabledPlugins: [],
|
|
326
|
-
onboardingComplete: true,
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
await saveConfig(updatedConfig);
|
|
330
|
-
await Promise.resolve(onComplete(updatedConfig));
|
|
331
|
-
} catch (error) {
|
|
332
|
-
setFinishError(summarizeError(error));
|
|
150
|
+
void finishOnboarding({
|
|
151
|
+
config,
|
|
152
|
+
baseConfig,
|
|
153
|
+
isBroker,
|
|
154
|
+
selectedTheme,
|
|
155
|
+
portfolioName,
|
|
156
|
+
onComplete,
|
|
157
|
+
}).catch((error) => {
|
|
158
|
+
setFinishError(summarizeOnboardingError(error));
|
|
333
159
|
setIsFinishing(false);
|
|
334
|
-
}
|
|
160
|
+
});
|
|
335
161
|
}, [
|
|
336
162
|
brokerSyncedConfig,
|
|
337
163
|
config,
|
|
@@ -343,7 +169,6 @@ export function OnboardingWizard({ config, pluginRegistry, onComplete }: Onboard
|
|
|
343
169
|
themeIdx,
|
|
344
170
|
]);
|
|
345
171
|
|
|
346
|
-
// Helper to update a broker field value
|
|
347
172
|
const setBrokerFieldValue = useCallback((brokerId: string, key: string, value: string) => {
|
|
348
173
|
resetBrokerSync();
|
|
349
174
|
setBrokerValues((prev) => ({
|
|
@@ -352,219 +177,49 @@ export function OnboardingWizard({ config, pluginRegistry, onComplete }: Onboard
|
|
|
352
177
|
}));
|
|
353
178
|
}, [resetBrokerSync]);
|
|
354
179
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
const nextIndex = brokerFieldIdx + 1;
|
|
385
|
-
const nextField = activeBrokerFields[nextIndex];
|
|
386
|
-
setBrokerFieldIdx(nextIndex);
|
|
387
|
-
setEditingField(nextField?.type !== "select");
|
|
388
|
-
} else {
|
|
389
|
-
void syncSelectedBroker(nextValues);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
} else if (isPlainEscape(event)) {
|
|
394
|
-
setEditingField(false);
|
|
395
|
-
if (portfolioSub === "broker-fields") {
|
|
396
|
-
setPortfolioSub("broker-setup");
|
|
397
|
-
} else {
|
|
398
|
-
setPortfolioSub("choose");
|
|
399
|
-
setBrokerFieldIdx(0);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
return; // Let input handle other keys
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
// --- Global nav ---
|
|
406
|
-
if (event.name === "return" || event.name === "enter") {
|
|
407
|
-
if (step === "ready") {
|
|
408
|
-
void finish();
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
if (step === "portfolio") {
|
|
412
|
-
if (portfolioSub === "choose") {
|
|
413
|
-
const choice = portfolioChoices[portfolioOptionIdx]!;
|
|
414
|
-
if (choice.id === "manual") {
|
|
415
|
-
resetBrokerSync();
|
|
416
|
-
setSelectedBrokerId(null);
|
|
417
|
-
setPortfolioSub("manual-name");
|
|
418
|
-
setEditingField(true);
|
|
419
|
-
} else {
|
|
420
|
-
resetBrokerSync();
|
|
421
|
-
setSelectedBrokerId(choice.id);
|
|
422
|
-
setBrokerFieldIdx(0);
|
|
423
|
-
setPortfolioSub("broker-fields");
|
|
424
|
-
const broker = brokerOptions.find((option) => option.id === choice.id);
|
|
425
|
-
const initialField = broker
|
|
426
|
-
? resolveBrokerConfigFields(broker.adapter, brokerValues[choice.id] ?? {}).filter((field) => field.required)[0]
|
|
427
|
-
: null;
|
|
428
|
-
setEditingField(initialField?.type !== "select");
|
|
429
|
-
}
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
if (portfolioSub === "broker-setup" && selectedBrokerId) {
|
|
433
|
-
setPortfolioSub("broker-fields");
|
|
434
|
-
const currentField = activeBrokerFields[brokerFieldIdx];
|
|
435
|
-
setEditingField(currentField?.type !== "select");
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
if (portfolioSub === "broker-fields" && selectedBrokerId) {
|
|
439
|
-
const currentField = activeBrokerFields[brokerFieldIdx];
|
|
440
|
-
if (!currentField) {
|
|
441
|
-
void syncSelectedBroker();
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
if (currentField.type === "select") {
|
|
445
|
-
const option = currentField.options?.[brokerSelectIdx];
|
|
446
|
-
if (!option) return;
|
|
447
|
-
setBrokerFieldValue(selectedBrokerId, currentField.key, option.value);
|
|
448
|
-
const nextValues = {
|
|
449
|
-
...(brokerValues[selectedBrokerId] ?? {}),
|
|
450
|
-
[currentField.key]: option.value,
|
|
451
|
-
};
|
|
452
|
-
const broker = brokerOptions.find((entry) => entry.id === selectedBrokerId);
|
|
453
|
-
const fields = broker
|
|
454
|
-
? resolveBrokerConfigFields(broker.adapter, nextValues).filter((field) => field.required)
|
|
455
|
-
: activeBrokerFields;
|
|
456
|
-
if (brokerFieldIdx < fields.length - 1) {
|
|
457
|
-
const nextIndex = brokerFieldIdx + 1;
|
|
458
|
-
const nextField = fields[nextIndex];
|
|
459
|
-
setBrokerFieldIdx(nextIndex);
|
|
460
|
-
// Show setup guide after connection mode is selected
|
|
461
|
-
if (currentField.key === "connectionMode") {
|
|
462
|
-
setPortfolioSub("broker-setup");
|
|
463
|
-
} else {
|
|
464
|
-
setEditingField(nextField?.type !== "select");
|
|
465
|
-
}
|
|
466
|
-
} else {
|
|
467
|
-
void syncSelectedBroker(nextValues);
|
|
468
|
-
}
|
|
469
|
-
return;
|
|
470
|
-
}
|
|
471
|
-
if (!editingField) {
|
|
472
|
-
setEditingField(true);
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
if (portfolioSub === "broker-sync") {
|
|
477
|
-
if (!isBrokerSyncing && brokerSyncError) {
|
|
478
|
-
void syncSelectedBroker();
|
|
479
|
-
}
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
nextStep();
|
|
484
|
-
} else if (isBackNavigationKey(event)) {
|
|
485
|
-
if (step === "portfolio" && portfolioSub === "broker-sync") {
|
|
486
|
-
resetBrokerSync();
|
|
487
|
-
setPortfolioSub("broker-fields");
|
|
488
|
-
return;
|
|
489
|
-
}
|
|
490
|
-
if (step === "portfolio" && portfolioSub === "broker-fields") {
|
|
491
|
-
setPortfolioSub("broker-setup");
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
if (step === "portfolio" && portfolioSub === "broker-setup") {
|
|
495
|
-
setPortfolioSub("broker-fields");
|
|
496
|
-
setBrokerFieldIdx(0);
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
if (step === "portfolio" && portfolioSub !== "choose") {
|
|
500
|
-
setPortfolioSub("choose");
|
|
501
|
-
setBrokerFieldIdx(0);
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
prevStep();
|
|
505
|
-
} else if (event.name === "left") {
|
|
506
|
-
if (step === "portfolio" && portfolioSub === "broker-sync") {
|
|
507
|
-
resetBrokerSync();
|
|
508
|
-
setPortfolioSub("broker-fields");
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
if (step === "portfolio" && portfolioSub === "broker-fields") {
|
|
512
|
-
setPortfolioSub("broker-setup");
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
if (step === "portfolio" && portfolioSub === "broker-setup") {
|
|
516
|
-
setPortfolioSub("broker-fields");
|
|
517
|
-
setBrokerFieldIdx(0);
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
|
-
if (step === "portfolio" && portfolioSub !== "choose") {
|
|
521
|
-
setPortfolioSub("choose");
|
|
522
|
-
setBrokerFieldIdx(0);
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
|
-
prevStep();
|
|
526
|
-
} else if (event.name === "right") {
|
|
527
|
-
nextStep();
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
// --- Step-specific controls ---
|
|
531
|
-
if (step === "theme") {
|
|
532
|
-
if (isPlainKey(event, "up", "k")) {
|
|
533
|
-
setThemeIdx((i) => Math.max(0, i - 1));
|
|
534
|
-
} else if (isPlainKey(event, "down", "j")) {
|
|
535
|
-
setThemeIdx((i) => Math.min(themeIds.length - 1, i + 1));
|
|
536
|
-
}
|
|
537
|
-
} else if (step === "portfolio" && portfolioSub === "choose") {
|
|
538
|
-
if (isPlainKey(event, "up", "k")) {
|
|
539
|
-
setPortfolioOptionIdx((i) => Math.max(0, i - 1));
|
|
540
|
-
} else if (isPlainKey(event, "down", "j")) {
|
|
541
|
-
setPortfolioOptionIdx((i) => Math.min(portfolioChoices.length - 1, i + 1));
|
|
542
|
-
}
|
|
543
|
-
} else if (step === "portfolio" && portfolioSub === "broker-fields" && selectedBrokerId) {
|
|
544
|
-
const currentField = activeBrokerFields[brokerFieldIdx];
|
|
545
|
-
if (currentField?.type === "select") {
|
|
546
|
-
const optionCount = currentField.options?.length ?? 0;
|
|
547
|
-
if (isPlainKey(event, "up", "k")) {
|
|
548
|
-
setBrokerSelectIdx((index) => Math.max(0, index - 1));
|
|
549
|
-
} else if (isPlainKey(event, "down", "j")) {
|
|
550
|
-
setBrokerSelectIdx((index) => Math.min(optionCount - 1, index + 1));
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
180
|
+
useOnboardingKeyboard({
|
|
181
|
+
step,
|
|
182
|
+
portfolioSub,
|
|
183
|
+
setPortfolioSub,
|
|
184
|
+
themeIds,
|
|
185
|
+
setThemeIdx,
|
|
186
|
+
portfolioChoices,
|
|
187
|
+
portfolioOptionIdx,
|
|
188
|
+
setPortfolioOptionIdx,
|
|
189
|
+
brokerOptions,
|
|
190
|
+
brokerValues,
|
|
191
|
+
selectedBrokerId,
|
|
192
|
+
setSelectedBrokerId,
|
|
193
|
+
activeBrokerFields,
|
|
194
|
+
brokerFieldIdx,
|
|
195
|
+
setBrokerFieldIdx,
|
|
196
|
+
brokerSelectIdx,
|
|
197
|
+
setBrokerSelectIdx,
|
|
198
|
+
editingField,
|
|
199
|
+
setEditingField,
|
|
200
|
+
isBrokerSyncing,
|
|
201
|
+
brokerSyncError,
|
|
202
|
+
isFinishing,
|
|
203
|
+
nextStep,
|
|
204
|
+
prevStep,
|
|
205
|
+
finish,
|
|
206
|
+
resetBrokerSync,
|
|
207
|
+
setBrokerFieldValue,
|
|
208
|
+
syncSelectedBroker,
|
|
554
209
|
});
|
|
555
210
|
|
|
556
211
|
const contentWidth = Math.min(60, termWidth - 4);
|
|
557
212
|
const contentLeft = Math.floor((termWidth - contentWidth) / 2);
|
|
558
213
|
const contentTop = Math.max(1, Math.floor((termHeight - 24) / 2));
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
if (i < stepIdx) return "\u2501";
|
|
563
|
-
if (i === stepIdx) return "\u25cf";
|
|
214
|
+
const progressDots = ONBOARDING_STEPS.map((_, index) => {
|
|
215
|
+
if (index < stepIdx) return "\u2501";
|
|
216
|
+
if (index === stepIdx) return "\u25cf";
|
|
564
217
|
return "\u00b7";
|
|
565
218
|
}).join(" ");
|
|
219
|
+
const connectedBrokerName = selectedBrokerId
|
|
220
|
+
? brokerOptions.find((broker) => broker.id === selectedBrokerId)?.name
|
|
221
|
+
: null;
|
|
566
222
|
|
|
567
|
-
// Bottom hint text
|
|
568
223
|
let hintText = "enter ->";
|
|
569
224
|
if (step === "ready") {
|
|
570
225
|
hintText = "enter to launch";
|
|
@@ -575,11 +230,6 @@ export function OnboardingWizard({ config, pluginRegistry, onComplete }: Onboard
|
|
|
575
230
|
hintText = "launching...";
|
|
576
231
|
}
|
|
577
232
|
|
|
578
|
-
// Determine what the ready step should show
|
|
579
|
-
const connectedBrokerName = selectedBrokerId
|
|
580
|
-
? brokerOptions.find((b) => b.id === selectedBrokerId)?.name
|
|
581
|
-
: null;
|
|
582
|
-
|
|
583
233
|
return (
|
|
584
234
|
<Box
|
|
585
235
|
position="absolute"
|
|
@@ -632,7 +282,6 @@ export function OnboardingWizard({ config, pluginRegistry, onComplete }: Onboard
|
|
|
632
282
|
/>
|
|
633
283
|
)}
|
|
634
284
|
|
|
635
|
-
{/* Bottom: progress + nav hints */}
|
|
636
285
|
<Box height={1} />
|
|
637
286
|
<Box height={1} flexDirection="row" width={contentWidth}>
|
|
638
287
|
<Box flexGrow={1}>
|
|
@@ -649,590 +298,3 @@ export function OnboardingWizard({ config, pluginRegistry, onComplete }: Onboard
|
|
|
649
298
|
</Box>
|
|
650
299
|
);
|
|
651
300
|
}
|
|
652
|
-
|
|
653
|
-
// --- Step Components ---
|
|
654
|
-
|
|
655
|
-
function WelcomeStep() {
|
|
656
|
-
return (
|
|
657
|
-
<Box flexDirection="column" paddingX={2}>
|
|
658
|
-
<Box height={1} />
|
|
659
|
-
<AsciiText text={LOGO_TEXT} font="wordmark" color={colors.textBright} />
|
|
660
|
-
<Box height={2} />
|
|
661
|
-
<Box height={1}>
|
|
662
|
-
<Text fg={colors.textDim}>{"The open terminal for modern finance."}</Text>
|
|
663
|
-
</Box>
|
|
664
|
-
<Box height={2} />
|
|
665
|
-
<Box height={1}>
|
|
666
|
-
<Text fg={colors.textMuted}>{"Let's set things up (~30s)."}</Text>
|
|
667
|
-
</Box>
|
|
668
|
-
<Box height={2} />
|
|
669
|
-
|
|
670
|
-
</Box>
|
|
671
|
-
);
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
function ThemeStep({ themeIds, selectedIdx, height }: { themeIds: string[]; selectedIdx: number; height: number }) {
|
|
675
|
-
const maxVisible = Math.min(themeIds.length, Math.max(6, height - 12));
|
|
676
|
-
const halfWindow = Math.floor(maxVisible / 2);
|
|
677
|
-
let windowStart = Math.max(0, Math.min(selectedIdx - halfWindow, themeIds.length - maxVisible));
|
|
678
|
-
if (windowStart < 0) windowStart = 0;
|
|
679
|
-
const windowEnd = Math.min(themeIds.length, windowStart + maxVisible);
|
|
680
|
-
|
|
681
|
-
return (
|
|
682
|
-
<Box flexDirection="column" paddingX={2}>
|
|
683
|
-
<Box height={1}>
|
|
684
|
-
<Text fg={colors.textBright} attributes={TextAttributes.BOLD}>{"Theme"}</Text>
|
|
685
|
-
</Box>
|
|
686
|
-
<Box height={1} />
|
|
687
|
-
<Box height={1} flexDirection="row">
|
|
688
|
-
<Text fg={colors.textDim}>{"Change it later from the command bar with "}</Text>
|
|
689
|
-
<Text fg={colors.text} attributes={TextAttributes.BOLD}>{"TH"}</Text>
|
|
690
|
-
</Box>
|
|
691
|
-
<Box height={1} />
|
|
692
|
-
<Box height={1}>
|
|
693
|
-
<Text fg={colors.positive}>{" \u2588\u2588 "}</Text>
|
|
694
|
-
<Text fg={colors.negative}>{" \u2588\u2588 "}</Text>
|
|
695
|
-
<Text fg={colors.text}>{" \u2588\u2588 "}</Text>
|
|
696
|
-
<Text fg={colors.textBright}>{" \u2588\u2588 "}</Text>
|
|
697
|
-
<Text fg={colors.borderFocused}>{" \u2588\u2588 "}</Text>
|
|
698
|
-
<Text fg={colors.textDim}>{" \u2588\u2588 "}</Text>
|
|
699
|
-
</Box>
|
|
700
|
-
<Box height={1} />
|
|
701
|
-
|
|
702
|
-
{windowStart > 0 && (
|
|
703
|
-
<Box height={1}>
|
|
704
|
-
<Text fg={colors.textMuted}>{"\u2191 more"}</Text>
|
|
705
|
-
</Box>
|
|
706
|
-
)}
|
|
707
|
-
|
|
708
|
-
{themeIds.slice(windowStart, windowEnd).map((id, i) => {
|
|
709
|
-
const theme = themes[id]!;
|
|
710
|
-
const globalIdx = windowStart + i;
|
|
711
|
-
const isSel = globalIdx === selectedIdx;
|
|
712
|
-
return (
|
|
713
|
-
<Box key={id} height={1} backgroundColor={isSel ? colors.selected : colors.bg}>
|
|
714
|
-
<Text fg={isSel ? colors.selectedText : colors.textDim}>
|
|
715
|
-
{isSel ? "\u25b8 " : " "}
|
|
716
|
-
</Text>
|
|
717
|
-
<Text fg={isSel ? colors.text : colors.textDim} attributes={isSel ? TextAttributes.BOLD : 0}>
|
|
718
|
-
{theme.name}
|
|
719
|
-
</Text>
|
|
720
|
-
</Box>
|
|
721
|
-
);
|
|
722
|
-
})}
|
|
723
|
-
|
|
724
|
-
{windowEnd < themeIds.length && (
|
|
725
|
-
<Box height={1}>
|
|
726
|
-
<Text fg={colors.textMuted}>{"\u2193 more"}</Text>
|
|
727
|
-
</Box>
|
|
728
|
-
)}
|
|
729
|
-
|
|
730
|
-
<Box height={1} />
|
|
731
|
-
<Box height={1}>
|
|
732
|
-
<Text fg={colors.textMuted}>{"Use \u2191\u2193 to browse"}</Text>
|
|
733
|
-
</Box>
|
|
734
|
-
</Box>
|
|
735
|
-
);
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
function PortfolioStep({
|
|
739
|
-
sub,
|
|
740
|
-
choices,
|
|
741
|
-
optionIdx,
|
|
742
|
-
onOptionSelect,
|
|
743
|
-
portfolioName,
|
|
744
|
-
onNameChange,
|
|
745
|
-
selectedBrokerId,
|
|
746
|
-
brokerFields,
|
|
747
|
-
brokerFieldIdx,
|
|
748
|
-
brokerSelectIdx,
|
|
749
|
-
brokerValues,
|
|
750
|
-
onBrokerFieldChange,
|
|
751
|
-
editing,
|
|
752
|
-
inputRef,
|
|
753
|
-
brokerSyncing,
|
|
754
|
-
brokerSyncError,
|
|
755
|
-
}: {
|
|
756
|
-
sub: PortfolioSub;
|
|
757
|
-
choices: ListViewItem[];
|
|
758
|
-
optionIdx: number;
|
|
759
|
-
onOptionSelect: (idx: number) => void;
|
|
760
|
-
portfolioName: string;
|
|
761
|
-
onNameChange: (n: string) => void;
|
|
762
|
-
selectedBrokerId: string | null;
|
|
763
|
-
brokerFields: BrokerConfigField[];
|
|
764
|
-
brokerFieldIdx: number;
|
|
765
|
-
brokerSelectIdx: number;
|
|
766
|
-
brokerValues: Record<string, Record<string, string>>;
|
|
767
|
-
onBrokerFieldChange: (brokerId: string, key: string, value: string) => void;
|
|
768
|
-
editing: boolean;
|
|
769
|
-
inputRef: RefObject<InputRenderable | null>;
|
|
770
|
-
brokerSyncing: boolean;
|
|
771
|
-
brokerSyncError: string | null;
|
|
772
|
-
}) {
|
|
773
|
-
if (sub === "choose") {
|
|
774
|
-
return (
|
|
775
|
-
<Box flexDirection="column" paddingX={2}>
|
|
776
|
-
<Box height={1}>
|
|
777
|
-
<Text fg={colors.textBright} attributes={TextAttributes.BOLD}>{"Set up a portfolio"}</Text>
|
|
778
|
-
</Box>
|
|
779
|
-
<Box height={1} />
|
|
780
|
-
<Box height={1}>
|
|
781
|
-
<Text fg={colors.textDim}>{"How would you like to get started?"}</Text>
|
|
782
|
-
</Box>
|
|
783
|
-
<Box height={2} />
|
|
784
|
-
|
|
785
|
-
<ListView
|
|
786
|
-
items={choices}
|
|
787
|
-
selectedIndex={optionIdx}
|
|
788
|
-
onSelect={onOptionSelect}
|
|
789
|
-
showSelectedDescription
|
|
790
|
-
/>
|
|
791
|
-
|
|
792
|
-
<Box height={1} />
|
|
793
|
-
<Box height={1}>
|
|
794
|
-
<Text fg={colors.textDim}>{"Edits later from the command bar."}</Text>
|
|
795
|
-
</Box>
|
|
796
|
-
<Box height={1} />
|
|
797
|
-
<Box height={1}>
|
|
798
|
-
<Text fg={colors.textMuted}>{"Use \u2191\u2193 to choose"}</Text>
|
|
799
|
-
</Box>
|
|
800
|
-
</Box>
|
|
801
|
-
);
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
if (sub === "manual-name") {
|
|
805
|
-
return (
|
|
806
|
-
<Box flexDirection="column" paddingX={2}>
|
|
807
|
-
<Box height={1}>
|
|
808
|
-
<Text fg={colors.textBright} attributes={TextAttributes.BOLD}>{"Name your portfolio"}</Text>
|
|
809
|
-
</Box>
|
|
810
|
-
<Box height={1} />
|
|
811
|
-
<Box height={1}>
|
|
812
|
-
<Text fg={colors.textDim}>{"Create watchlists later."}</Text>
|
|
813
|
-
</Box>
|
|
814
|
-
<Box height={2} />
|
|
815
|
-
<Box height={1}>
|
|
816
|
-
<Text fg={colors.text}>{"Portfolio name:"}</Text>
|
|
817
|
-
</Box>
|
|
818
|
-
<Box height={1}>
|
|
819
|
-
{editing ? (
|
|
820
|
-
<TextField
|
|
821
|
-
inputRef={inputRef}
|
|
822
|
-
value={portfolioName}
|
|
823
|
-
placeholder="Main Portfolio"
|
|
824
|
-
focused
|
|
825
|
-
backgroundColor={colors.panel}
|
|
826
|
-
textColor={colors.text}
|
|
827
|
-
placeholderColor={colors.textDim}
|
|
828
|
-
onChange={onNameChange}
|
|
829
|
-
onSubmit={() => {}}
|
|
830
|
-
/>
|
|
831
|
-
) : (
|
|
832
|
-
<Text fg={colors.textBright} attributes={TextAttributes.BOLD}>
|
|
833
|
-
{`> ${portfolioName}`}
|
|
834
|
-
</Text>
|
|
835
|
-
)}
|
|
836
|
-
</Box>
|
|
837
|
-
<Box height={2} />
|
|
838
|
-
<Box height={1} flexDirection="row">
|
|
839
|
-
<Text fg={colors.textDim}>{"After setup, use the command bar ("}</Text>
|
|
840
|
-
<Text fg={colors.text}>{"Ctrl+P"}</Text>
|
|
841
|
-
<Text fg={colors.textDim}>{") and"}</Text>
|
|
842
|
-
</Box>
|
|
843
|
-
<Box height={1} flexDirection="row">
|
|
844
|
-
<Text fg={colors.textDim}>{"type "}</Text>
|
|
845
|
-
<Text fg={colors.text} attributes={TextAttributes.BOLD}>{"DES AAPL"}</Text>
|
|
846
|
-
<Text fg={colors.textDim}>{" to open security details for a stock or ETF."}</Text>
|
|
847
|
-
</Box>
|
|
848
|
-
</Box>
|
|
849
|
-
);
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
if (sub === "broker-setup" && selectedBrokerId) {
|
|
853
|
-
const brokerLabel = choices.find((c) => c.id === selectedBrokerId)?.label.replace("Connect ", "") ?? selectedBrokerId;
|
|
854
|
-
const connectionMode = brokerValues[selectedBrokerId]?.connectionMode;
|
|
855
|
-
const isGateway = connectionMode === "gateway";
|
|
856
|
-
|
|
857
|
-
return (
|
|
858
|
-
<Box flexDirection="column" paddingX={2}>
|
|
859
|
-
<Box height={1}>
|
|
860
|
-
<Text fg={colors.textBright} attributes={TextAttributes.BOLD}>
|
|
861
|
-
{`Setup Guide — ${brokerLabel}`}
|
|
862
|
-
</Text>
|
|
863
|
-
</Box>
|
|
864
|
-
<Box height={1} />
|
|
865
|
-
|
|
866
|
-
{selectedBrokerId === "ibkr" && !isGateway && (
|
|
867
|
-
<>
|
|
868
|
-
<Box height={1}>
|
|
869
|
-
<Text fg={colors.textDim}>{"You'll need 2 things from IBKR Account Management:"}</Text>
|
|
870
|
-
</Box>
|
|
871
|
-
<Box height={2} />
|
|
872
|
-
<Box height={1}>
|
|
873
|
-
<Text fg={colors.textDim}>{"1. Go to "}<Underline><Span fg={colors.text}>{"Reports > Flex Queries"}</Span></Underline></Text>
|
|
874
|
-
</Box>
|
|
875
|
-
<Box height={1}>
|
|
876
|
-
<Text fg={colors.textDim}>{"2. Create a Flex Query that includes positions data"}</Text>
|
|
877
|
-
</Box>
|
|
878
|
-
<Box height={1}>
|
|
879
|
-
<Text fg={colors.textDim}>{"3. Note the "}<Strong><Span fg={colors.text}>{"Query ID"}</Span></Strong>{" (numeric)"}</Text>
|
|
880
|
-
</Box>
|
|
881
|
-
<Box height={1}>
|
|
882
|
-
<Text fg={colors.textDim}>{"4. Under "}<Underline><Span fg={colors.text}>{"Reports > Settings"}</Span></Underline>{", generate a "}<Strong><Span fg={colors.text}>{"Flex Web Service Token"}</Span></Strong></Text>
|
|
883
|
-
</Box>
|
|
884
|
-
<Box height={2} />
|
|
885
|
-
<ExternalLink url="https://www.ibkrguides.com/orgportal/performanceandstatements/flex.htm" />
|
|
886
|
-
</>
|
|
887
|
-
)}
|
|
888
|
-
|
|
889
|
-
{selectedBrokerId === "ibkr" && isGateway && (
|
|
890
|
-
<>
|
|
891
|
-
<Box height={1}>
|
|
892
|
-
<Text fg={colors.textDim}>{"You'll need IB Gateway or TWS running locally:"}</Text>
|
|
893
|
-
</Box>
|
|
894
|
-
<Box height={2} />
|
|
895
|
-
<Box height={1}>
|
|
896
|
-
<Text fg={colors.textDim}>{"1. Download and install "}<Strong><Span fg={colors.text}>{"IB Gateway"}</Span></Strong>{" (or use TWS)"}</Text>
|
|
897
|
-
</Box>
|
|
898
|
-
<Box height={1}>
|
|
899
|
-
<Text fg={colors.textDim}>{"2. Log in with your IBKR credentials"}</Text>
|
|
900
|
-
</Box>
|
|
901
|
-
<Box height={1}>
|
|
902
|
-
<Text fg={colors.textDim}>{"3. In "}<Underline><Span fg={colors.text}>{"Configuration > API > Settings"}</Span></Underline>{":"}</Text>
|
|
903
|
-
</Box>
|
|
904
|
-
<Box height={1}>
|
|
905
|
-
<Text fg={colors.textDim}>{" Enable \"ActiveX and Socket Clients\""}</Text>
|
|
906
|
-
</Box>
|
|
907
|
-
<Box height={1}>
|
|
908
|
-
<Text fg={colors.textDim}>{" Gloomberb can auto-detect local API ports (4001, 4002, 7496, 7497)"}</Text>
|
|
909
|
-
</Box>
|
|
910
|
-
<Box height={1}>
|
|
911
|
-
<Text fg={colors.textDim}>{" Use Manual setup only if you need a custom host or exact socket port"}</Text>
|
|
912
|
-
</Box>
|
|
913
|
-
<Box height={1}>
|
|
914
|
-
<Text fg={colors.textDim}>{"4. Keep it running while using Gloomberb"}</Text>
|
|
915
|
-
</Box>
|
|
916
|
-
<Box height={2} />
|
|
917
|
-
<ExternalLink url="https://www.interactivebrokers.com/en/trading/ibgateway-stable.php" />
|
|
918
|
-
</>
|
|
919
|
-
)}
|
|
920
|
-
|
|
921
|
-
{selectedBrokerId !== "ibkr" && (
|
|
922
|
-
<>
|
|
923
|
-
<Box height={1}>
|
|
924
|
-
<Text fg={colors.textDim}>{`You'll need your ${brokerLabel} API credentials.`}</Text>
|
|
925
|
-
</Box>
|
|
926
|
-
<Box height={1}>
|
|
927
|
-
<Text fg={colors.textDim}>{"Check your broker's documentation for setup instructions."}</Text>
|
|
928
|
-
</Box>
|
|
929
|
-
</>
|
|
930
|
-
)}
|
|
931
|
-
|
|
932
|
-
<Box height={2} />
|
|
933
|
-
|
|
934
|
-
</Box>
|
|
935
|
-
);
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
if (sub === "broker-sync" && selectedBrokerId) {
|
|
939
|
-
const brokerLabel = choices.find((choice) => choice.id === selectedBrokerId)?.label.replace("Connect ", "") ?? selectedBrokerId;
|
|
940
|
-
return (
|
|
941
|
-
<Box flexDirection="column" paddingX={2}>
|
|
942
|
-
<Box height={1}>
|
|
943
|
-
<Text fg={colors.textBright} attributes={TextAttributes.BOLD}>{`Connect ${brokerLabel}`}</Text>
|
|
944
|
-
</Box>
|
|
945
|
-
<Box height={1} />
|
|
946
|
-
<Box height={1}>
|
|
947
|
-
<Text fg={brokerSyncing ? colors.text : colors.negative}>
|
|
948
|
-
{brokerSyncing
|
|
949
|
-
? `Connecting to ${brokerLabel} and importing accounts and positions...`
|
|
950
|
-
: brokerSyncError || `Unable to sync ${brokerLabel}.`}
|
|
951
|
-
</Text>
|
|
952
|
-
</Box>
|
|
953
|
-
<Box height={2} />
|
|
954
|
-
<Box height={1}>
|
|
955
|
-
<Text fg={colors.textDim}>
|
|
956
|
-
{brokerSyncing
|
|
957
|
-
? "This happens now so your portfolio is ready before onboarding finishes."
|
|
958
|
-
: "Press Enter to retry, or Backspace to edit the broker settings."}
|
|
959
|
-
</Text>
|
|
960
|
-
</Box>
|
|
961
|
-
</Box>
|
|
962
|
-
);
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
// broker-fields: dynamically render fields from the broker's configSchema
|
|
966
|
-
if (!selectedBrokerId) return null;
|
|
967
|
-
const values = brokerValues[selectedBrokerId] ?? {};
|
|
968
|
-
|
|
969
|
-
return (
|
|
970
|
-
<Box flexDirection="column" paddingX={2}>
|
|
971
|
-
<Box height={1}>
|
|
972
|
-
<Text fg={colors.textBright} attributes={TextAttributes.BOLD}>
|
|
973
|
-
{"Connect "}{choices.find((c) => c.id === selectedBrokerId)?.label.replace("Connect ", "") ?? selectedBrokerId}
|
|
974
|
-
</Text>
|
|
975
|
-
</Box>
|
|
976
|
-
<Box height={1} />
|
|
977
|
-
|
|
978
|
-
{/* Show completed fields */}
|
|
979
|
-
{brokerFields.map((field, i) => {
|
|
980
|
-
if (i > brokerFieldIdx) return null;
|
|
981
|
-
const val = values[field.key] ?? "";
|
|
982
|
-
const isActive = i === brokerFieldIdx;
|
|
983
|
-
|
|
984
|
-
if (!isActive && val) {
|
|
985
|
-
const selectedLabel = field.type === "select"
|
|
986
|
-
? field.options?.find((option) => option.value === val)?.label ?? val
|
|
987
|
-
: field.type === "password" ? PASSWORD_MASK_CHAR.repeat(val.length) : val;
|
|
988
|
-
return (
|
|
989
|
-
<Box key={field.key} height={1}>
|
|
990
|
-
<Text fg={colors.positive}>{"\u2713 "}</Text>
|
|
991
|
-
<Text fg={colors.text}>{`${field.label}: ${selectedLabel}`}</Text>
|
|
992
|
-
</Box>
|
|
993
|
-
);
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
if (isActive) {
|
|
997
|
-
const activeSelectValue = field.options?.[brokerSelectIdx]?.value ?? values[field.key] ?? "";
|
|
998
|
-
const effectiveValue = val || field.defaultValue || "";
|
|
999
|
-
return (
|
|
1000
|
-
<Box key={field.key} flexDirection="column">
|
|
1001
|
-
{i > 0 && <Box height={1} />}
|
|
1002
|
-
<Box height={1}>
|
|
1003
|
-
<Text fg={colors.text} attributes={TextAttributes.BOLD}>
|
|
1004
|
-
{`Step ${i + 1}: `}
|
|
1005
|
-
</Text>
|
|
1006
|
-
<Text fg={colors.text}>{field.label}</Text>
|
|
1007
|
-
</Box>
|
|
1008
|
-
<Box height={1}>
|
|
1009
|
-
{field.type !== "select" && (editing ? (
|
|
1010
|
-
<TextField
|
|
1011
|
-
inputRef={inputRef}
|
|
1012
|
-
value={val}
|
|
1013
|
-
type={field.type === "password" ? "password" : "text"}
|
|
1014
|
-
placeholder={field.placeholder || `Enter ${field.label.toLowerCase()}`}
|
|
1015
|
-
focused
|
|
1016
|
-
backgroundColor={colors.panel}
|
|
1017
|
-
textColor={colors.text}
|
|
1018
|
-
placeholderColor={colors.textDim}
|
|
1019
|
-
onChange={(nextValue) => onBrokerFieldChange(selectedBrokerId, field.key, nextValue)}
|
|
1020
|
-
onSubmit={() => {}}
|
|
1021
|
-
/>
|
|
1022
|
-
) : (
|
|
1023
|
-
<Text fg={effectiveValue ? colors.positive : colors.textMuted}>
|
|
1024
|
-
{effectiveValue
|
|
1025
|
-
? `\u2713 ${field.label}: ${field.type === "password" ? PASSWORD_MASK_CHAR.repeat(effectiveValue.length) : effectiveValue}`
|
|
1026
|
-
: "Press enter to type..."}
|
|
1027
|
-
</Text>
|
|
1028
|
-
))}
|
|
1029
|
-
</Box>
|
|
1030
|
-
{field.type !== "select" && !val && field.defaultValue && (
|
|
1031
|
-
<Box height={1}>
|
|
1032
|
-
<Text fg={colors.textMuted}>{`Press enter to use ${field.defaultValue}`}</Text>
|
|
1033
|
-
</Box>
|
|
1034
|
-
)}
|
|
1035
|
-
{field.type === "select" && (
|
|
1036
|
-
<Box flexDirection="column">
|
|
1037
|
-
{(field.options ?? []).map((option, optionIdx) => {
|
|
1038
|
-
const selected = optionIdx === brokerSelectIdx;
|
|
1039
|
-
return (
|
|
1040
|
-
<Box key={option.value} flexDirection="column" backgroundColor={selected ? colors.selected : colors.bg}>
|
|
1041
|
-
<Box height={1}>
|
|
1042
|
-
<Text fg={selected ? colors.selectedText : colors.textDim}>{selected ? "\u25b8 " : " "}</Text>
|
|
1043
|
-
<Text
|
|
1044
|
-
fg={selected ? colors.text : colors.textDim}
|
|
1045
|
-
attributes={selected ? TextAttributes.BOLD : 0}
|
|
1046
|
-
>
|
|
1047
|
-
{option.label}
|
|
1048
|
-
</Text>
|
|
1049
|
-
</Box>
|
|
1050
|
-
{option.description && (
|
|
1051
|
-
<Box height={1}>
|
|
1052
|
-
<Text fg={colors.textMuted}>{` ${option.description}`}</Text>
|
|
1053
|
-
</Box>
|
|
1054
|
-
)}
|
|
1055
|
-
</Box>
|
|
1056
|
-
);
|
|
1057
|
-
})}
|
|
1058
|
-
</Box>
|
|
1059
|
-
)}
|
|
1060
|
-
{field.type === "select" && (
|
|
1061
|
-
<Box height={1}>
|
|
1062
|
-
<Text fg={colors.textMuted}>
|
|
1063
|
-
{activeSelectValue ? `Selected: ${field.options?.find((option) => option.value === activeSelectValue)?.label ?? activeSelectValue}` : "Use \u2191\u2193 to choose"}
|
|
1064
|
-
</Text>
|
|
1065
|
-
</Box>
|
|
1066
|
-
)}
|
|
1067
|
-
</Box>
|
|
1068
|
-
);
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
return null;
|
|
1072
|
-
})}
|
|
1073
|
-
|
|
1074
|
-
<Box height={2} />
|
|
1075
|
-
<Box height={1}>
|
|
1076
|
-
<Text fg={colors.textDim}>{"Credentials are saved locally."}</Text>
|
|
1077
|
-
</Box>
|
|
1078
|
-
<Box height={1} />
|
|
1079
|
-
<Box height={1}>
|
|
1080
|
-
<Text fg={colors.textMuted}>
|
|
1081
|
-
{`Field ${brokerFieldIdx + 1} of ${brokerFields.length}`}
|
|
1082
|
-
</Text>
|
|
1083
|
-
</Box>
|
|
1084
|
-
</Box>
|
|
1085
|
-
);
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
function ShortcutsStep({ pluginRegistry }: { pluginRegistry: PluginRegistry }) {
|
|
1089
|
-
const uiHost = useUiHost();
|
|
1090
|
-
const shortcutPlatform = detectShortcutPlatform();
|
|
1091
|
-
const shortcutDisplayMode = getShortcutDisplayMode(uiHost.kind);
|
|
1092
|
-
const platformShortcut = (keys: string | readonly string[]) => formatPrimaryShortcut(keys, shortcutPlatform, shortcutDisplayMode);
|
|
1093
|
-
const keyboardShortcuts = [
|
|
1094
|
-
{ key: "Ctrl+P / `", desc: "Open the command bar" },
|
|
1095
|
-
{ key: "Tab", desc: "Switch between panels" },
|
|
1096
|
-
{ key: platformShortcut("W"), desc: "Close the focused pane" },
|
|
1097
|
-
{ key: platformShortcut(["Shift", "D"]), desc: "Dock or float the focused pane" },
|
|
1098
|
-
{ key: "q", desc: "Quit" },
|
|
1099
|
-
];
|
|
1100
|
-
|
|
1101
|
-
const commandPrefixes = useMemo(() => {
|
|
1102
|
-
const builtIn = [
|
|
1103
|
-
{ key: "DES AAPL", desc: "Open security details" },
|
|
1104
|
-
{ key: "TH", desc: "Switch theme" },
|
|
1105
|
-
{ key: "PL", desc: "Toggle plugins" },
|
|
1106
|
-
{ key: "PS", desc: "Edit the current window settings" },
|
|
1107
|
-
{ key: "HELP", desc: "Open the help window" },
|
|
1108
|
-
];
|
|
1109
|
-
|
|
1110
|
-
const builtInKeys = new Set(builtIn.map((b) => b.key.split(" ")[0]));
|
|
1111
|
-
const pluginPrefixes: { key: string; desc: string }[] = [];
|
|
1112
|
-
|
|
1113
|
-
for (const [, template] of pluginRegistry.paneTemplates) {
|
|
1114
|
-
if (!template.shortcut) continue;
|
|
1115
|
-
if (builtInKeys.has(template.shortcut.prefix)) continue;
|
|
1116
|
-
const label = template.shortcut.argPlaceholder
|
|
1117
|
-
? `${template.shortcut.prefix} <${template.shortcut.argPlaceholder}>`
|
|
1118
|
-
: template.shortcut.prefix;
|
|
1119
|
-
pluginPrefixes.push({ key: label, desc: template.label });
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
|
-
pluginPrefixes.sort((a, b) => a.key.localeCompare(b.key));
|
|
1123
|
-
return [...builtIn, ...pluginPrefixes];
|
|
1124
|
-
}, [pluginRegistry]);
|
|
1125
|
-
|
|
1126
|
-
const COL = 20;
|
|
1127
|
-
|
|
1128
|
-
return (
|
|
1129
|
-
<Box flexDirection="column" paddingX={2}>
|
|
1130
|
-
<Box height={1}>
|
|
1131
|
-
<Text fg={colors.textBright} attributes={TextAttributes.BOLD}>{"After launch shortcuts"}</Text>
|
|
1132
|
-
</Box>
|
|
1133
|
-
<Box height={1} />
|
|
1134
|
-
|
|
1135
|
-
{keyboardShortcuts.map((s) => (
|
|
1136
|
-
<Box key={s.key} height={1} flexDirection="row">
|
|
1137
|
-
<Text fg={colors.text} attributes={TextAttributes.BOLD}>{s.key.padEnd(COL)}</Text>
|
|
1138
|
-
<Text fg={colors.textDim}>{s.desc}</Text>
|
|
1139
|
-
</Box>
|
|
1140
|
-
))}
|
|
1141
|
-
|
|
1142
|
-
<Box height={2} />
|
|
1143
|
-
<Box height={1}>
|
|
1144
|
-
<Text fg={colors.textBright} attributes={TextAttributes.BOLD}>{"Command-bar prefixes"}</Text>
|
|
1145
|
-
</Box>
|
|
1146
|
-
<Box height={1} />
|
|
1147
|
-
<Box height={1}>
|
|
1148
|
-
<Text fg={colors.textDim}>{"Type these in the command bar ("}<Span fg={colors.text}><Strong>{"Ctrl+P"}</Strong></Span>{" or "}<Span fg={colors.text}><Strong>{"`"}</Strong></Span>{"):"}</Text>
|
|
1149
|
-
</Box>
|
|
1150
|
-
<Box height={1} />
|
|
1151
|
-
|
|
1152
|
-
{commandPrefixes.map((s) => (
|
|
1153
|
-
<Box key={s.key} height={1} flexDirection="row">
|
|
1154
|
-
<Text fg={colors.text} attributes={TextAttributes.BOLD}>{s.key.padEnd(COL)}</Text>
|
|
1155
|
-
<Text fg={colors.textDim}>{s.desc}</Text>
|
|
1156
|
-
</Box>
|
|
1157
|
-
))}
|
|
1158
|
-
|
|
1159
|
-
<Box height={2} />
|
|
1160
|
-
<Box height={1}>
|
|
1161
|
-
<Text fg={colors.textDim}>{"Everything is searchable, just type what you want."}</Text>
|
|
1162
|
-
</Box>
|
|
1163
|
-
</Box>
|
|
1164
|
-
);
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
function ReadyStep({
|
|
1168
|
-
brokerName,
|
|
1169
|
-
portfolioName,
|
|
1170
|
-
brokerSyncSummary,
|
|
1171
|
-
isFinishing,
|
|
1172
|
-
error,
|
|
1173
|
-
}: {
|
|
1174
|
-
brokerName: string | null;
|
|
1175
|
-
portfolioName: string;
|
|
1176
|
-
brokerSyncSummary: BrokerSyncSummary | null;
|
|
1177
|
-
isFinishing: boolean;
|
|
1178
|
-
error: string | null;
|
|
1179
|
-
}) {
|
|
1180
|
-
const positionsImported = brokerSyncSummary?.positionsImported ?? 0;
|
|
1181
|
-
const positionLabel = positionsImported === 1 ? "position" : "positions";
|
|
1182
|
-
|
|
1183
|
-
return (
|
|
1184
|
-
<Box flexDirection="column" paddingX={2}>
|
|
1185
|
-
<Box height={2} />
|
|
1186
|
-
<Box height={1}>
|
|
1187
|
-
<Text fg={colors.textBright} attributes={TextAttributes.BOLD}>{"You're all set"}</Text>
|
|
1188
|
-
</Box>
|
|
1189
|
-
<Box height={2} />
|
|
1190
|
-
<Box height={1}>
|
|
1191
|
-
<Text fg={colors.positive} attributes={TextAttributes.BOLD}>{"\u2713"}</Text>
|
|
1192
|
-
<Text fg={colors.text}>{" Theme configured"}</Text>
|
|
1193
|
-
</Box>
|
|
1194
|
-
<Box height={1}>
|
|
1195
|
-
<Text fg={colors.positive} attributes={TextAttributes.BOLD}>{"\u2713"}</Text>
|
|
1196
|
-
<Text fg={colors.text}>
|
|
1197
|
-
{brokerName
|
|
1198
|
-
? ` ${brokerName} connected. Imported ${positionsImported} ${positionLabel}`
|
|
1199
|
-
: ` Portfolio "${portfolioName}" created`}
|
|
1200
|
-
</Text>
|
|
1201
|
-
</Box>
|
|
1202
|
-
<Box height={1}>
|
|
1203
|
-
<Text fg={colors.positive} attributes={TextAttributes.BOLD}>{"\u2713"}</Text>
|
|
1204
|
-
<Text fg={colors.text}>{" Plugins enabled"}</Text>
|
|
1205
|
-
</Box>
|
|
1206
|
-
<Box height={2} />
|
|
1207
|
-
{brokerName ? (
|
|
1208
|
-
<Box height={1}>
|
|
1209
|
-
<Text fg={isFinishing ? colors.text : colors.textDim}>
|
|
1210
|
-
{isFinishing
|
|
1211
|
-
? "Launching Gloomberb..."
|
|
1212
|
-
: positionsImported > 0
|
|
1213
|
-
? "Your broker portfolio is ready and will open directly after launch."
|
|
1214
|
-
: "Broker sync finished. If you expected holdings, check the selected account or connection mode."}
|
|
1215
|
-
</Text>
|
|
1216
|
-
</Box>
|
|
1217
|
-
) : (
|
|
1218
|
-
<Box height={1}>
|
|
1219
|
-
<Text fg={colors.textDim}>{"Search for broker names in the command bar to connect."}</Text>
|
|
1220
|
-
</Box>
|
|
1221
|
-
)}
|
|
1222
|
-
{error && (
|
|
1223
|
-
<>
|
|
1224
|
-
<Box height={1} />
|
|
1225
|
-
<Box height={2}>
|
|
1226
|
-
<Text fg={colors.negative}>{error}</Text>
|
|
1227
|
-
</Box>
|
|
1228
|
-
</>
|
|
1229
|
-
)}
|
|
1230
|
-
<Box height={2} />
|
|
1231
|
-
<Box height={1} flexDirection="row">
|
|
1232
|
-
<Text fg={colors.textDim}>{"Data stored in "}</Text>
|
|
1233
|
-
<Text fg={colors.text}>{"~/gloomberb/"}</Text>
|
|
1234
|
-
</Box>
|
|
1235
|
-
<Box height={1} />
|
|
1236
|
-
</Box>
|
|
1237
|
-
);
|
|
1238
|
-
}
|