gloomberb 0.10.4 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +30 -3
- package/README.zh-CN.md +1 -1
- package/package.json +5 -5
- package/src/api-client/auth.ts +34 -0
- package/src/api-client/data.ts +25 -0
- package/src/api-client/index.test.ts +81 -0
- package/src/api-client/index.ts +37 -0
- package/src/api-client/request.test.ts +30 -0
- package/src/api-client/request.ts +44 -20
- package/src/api-client/socket-health.test.ts +79 -0
- package/src/api-client/socket.ts +108 -5
- package/src/api-client/types.ts +139 -0
- package/src/app/global-shortcuts.test.tsx +144 -9
- package/src/app/global-shortcuts.ts +33 -11
- package/src/app/runtime/broker-import.ts +39 -5
- package/src/app/runtime/startup.ts +7 -1
- package/src/app/runtime/update.ts +26 -1
- package/src/app.tsx +36 -19
- package/src/brokers/broker-ticker-sync.ts +3 -8
- package/src/brokers/sync-broker-instance.test.ts +59 -0
- package/src/brokers/sync-broker-instance.ts +37 -13
- package/src/capabilities/chart-series.ts +318 -0
- package/src/capabilities/factories.ts +46 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/registry.test.ts +135 -0
- package/src/capabilities/registry.ts +31 -4
- package/src/capabilities/types.ts +52 -0
- package/src/cli/commands/overview.ts +2 -2
- package/src/cli/desktop-pane-shot.ts +2 -0
- package/src/cli/entry.ts +11 -1
- package/src/cli/native-smoke.ts +5 -0
- package/src/cli/pane-functions/catalog.ts +4 -0
- package/src/cli/pane-functions/data.ts +6 -1
- package/src/cli/pane-functions/discovery.ts +76 -10
- package/src/cli/pane-functions/report.test.ts +76 -0
- package/src/cli/pane-functions/report.ts +7 -1
- package/src/cli/pane-functions/resolver.ts +4 -1
- package/src/cli/pane-functions/screenshot.test.ts +56 -3
- package/src/cli/pane-functions/screenshot.ts +68 -5
- package/src/components/chart/composite/composite-chart.test.tsx +54 -0
- package/src/components/chart/composite/composite-chart.tsx +92 -15
- package/src/components/chart/composite/downsample.test.ts +136 -0
- package/src/components/chart/composite/downsample.ts +208 -0
- package/src/components/chart/composite/panel-series.test.ts +66 -0
- package/src/components/chart/composite/panel-series.ts +101 -0
- package/src/components/chart/multi-line/renderer.ts +1 -0
- package/src/components/chart/native/kitty/index.test.ts +25 -3
- package/src/components/chart/native/kitty/support.ts +37 -3
- package/src/components/chart/native/use-chart-text-fallback.ts +19 -0
- package/src/components/chart/static/chart/surface.tsx +43 -12
- package/src/components/chart/static/multi-line-chart-surface.tsx +41 -5
- package/src/components/command-bar/commands/direct/index.ts +18 -0
- package/src/components/command-bar/commands/registry.ts +14 -0
- package/src/components/command-bar/routes/root/article-results.test.ts +83 -0
- package/src/components/command-bar/routes/root/article-results.ts +55 -0
- package/src/components/command-bar/routes/root/command-items.ts +3 -0
- package/src/components/command-bar/routes/root/provider-search.ts +7 -3
- package/src/components/command-bar/routes/root/results.ts +38 -11
- package/src/components/command-bar/routes/root/runtime.ts +6 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +1 -1
- package/src/components/command-bar/routes/ticker-search/results.test.ts +34 -0
- package/src/components/command-bar/routes/ticker-search/results.ts +4 -6
- package/src/components/command-bar/routes/ticker-search/route.ts +2 -2
- package/src/components/command-bar/routing/list-state.ts +2 -1
- package/src/components/command-bar/surface/assist.test.tsx +13 -6
- package/src/components/command-bar/surface/index.test.tsx +65 -0
- package/src/components/command-bar/surface/index.tsx +35 -0
- package/src/components/command-bar/view-model.test.ts +43 -0
- package/src/components/command-bar/view-model.ts +41 -4
- package/src/components/command-bar/workflow/collection-actions.test.ts +94 -0
- package/src/components/command-bar/workflow/collection-actions.ts +14 -3
- package/src/components/command-bar/workflow/ops.test.ts +136 -0
- package/src/components/command-bar/workflow/ops.ts +71 -1
- package/src/components/index.ts +1 -1
- package/src/components/layout/header.test.tsx +35 -0
- package/src/components/layout/header.tsx +101 -9
- package/src/components/layout/pane/cycle-order.test.ts +0 -1
- package/src/components/layout/pane/footer/index.test.tsx +19 -19
- package/src/components/layout/pane/header.tsx +2 -13
- package/src/components/layout/shell/index.tsx +3 -0
- package/src/components/layout/status-bar.test.tsx +36 -1
- package/src/components/layout/status-bar.tsx +48 -2
- package/src/components/onboarding/account-step/chooser-panel.tsx +27 -50
- package/src/components/onboarding/account-step/form-panel.tsx +85 -29
- package/src/components/onboarding/account-step/index.tsx +10 -1
- package/src/components/onboarding/account-step/model.ts +3 -3
- package/src/components/onboarding/account-step/qr-panel.tsx +68 -0
- package/src/components/onboarding/account-step/signed-in-panel.tsx +4 -7
- package/src/components/onboarding/onboarding-frame.tsx +517 -0
- package/src/components/onboarding/onboarding-steps.tsx +0 -264
- package/src/components/onboarding/onboarding-wizard.test.tsx +626 -200
- package/src/components/onboarding/onboarding-wizard.tsx +848 -266
- package/src/components/onboarding/portfolio-step/broker-fields-panel.tsx +81 -51
- package/src/components/onboarding/portfolio-step/broker-setup-panel.tsx +14 -20
- package/src/components/onboarding/portfolio-step/broker-sync-panel.tsx +8 -11
- package/src/components/onboarding/portfolio-step/choose-panel.tsx +18 -22
- package/src/components/onboarding/portfolio-step/index.tsx +3 -0
- package/src/components/onboarding/portfolio-step/types.ts +3 -0
- package/src/components/onboarding/wizard-account.ts +38 -3
- package/src/components/onboarding/wizard-broker-sync.ts +45 -67
- package/src/components/onboarding/wizard-model.ts +18 -2
- package/src/components/ui/data-table/opentui/index.tsx +29 -9
- package/src/components/ui/data-table/types.ts +2 -0
- package/src/components/ui/external-link.tsx +4 -2
- package/src/components/ui/loading.tsx +1 -1
- package/src/components/ui/status.tsx +76 -4
- package/src/components/ui/table-layout.test.ts +24 -0
- package/src/components/ui/table-layout.ts +90 -23
- package/src/components/ui/tabs.tsx +86 -4
- package/src/core/app-services.ts +14 -3
- package/src/core/connection-health.test.ts +143 -0
- package/src/core/connection-health.ts +295 -0
- package/src/core/state/app/layout-reducer.ts +34 -0
- package/src/core/state/app/layout.ts +21 -0
- package/src/core/state/app/state.ts +10 -0
- package/src/core/state/app/types.ts +7 -1
- package/src/data/config/chart-settings.ts +11 -2
- package/src/data/config/store/index.test.ts +83 -9
- package/src/data/config/store/migrations.ts +16 -0
- package/src/data/config/store/normalize.ts +59 -1
- package/src/data/fred-series.ts +8 -2
- package/src/i18n/es.ts +126 -0
- package/src/i18n/ja.ts +126 -0
- package/src/i18n/ko.ts +126 -0
- package/src/i18n/zh-cn.ts +126 -0
- package/src/i18n/zh-tw.ts +126 -0
- package/src/market-data/coordinator/chart.ts +3 -2
- package/src/market-data/hooks.tsx +3 -2
- package/src/market-data/market/status.test.ts +12 -0
- package/src/market-data/market/status.ts +34 -17
- package/src/news/aggregator.test.ts +39 -0
- package/src/news/aggregator.ts +78 -22
- package/src/news/hooks.ts +4 -0
- package/src/notifications/app-notifier.test.ts +28 -6
- package/src/notifications/app-notifier.ts +24 -5
- package/src/plugins/broker-sync/broker-sync.test.ts +130 -0
- package/src/plugins/broker-sync/native-loader.ts +10 -0
- package/src/plugins/broker-sync/normalize.ts +271 -0
- package/src/plugins/broker-sync/public.ts +122 -0
- package/src/plugins/broker-sync/robinhood-native.ts +367 -0
- package/src/plugins/broker-sync/robinhood.ts +114 -0
- package/src/plugins/broker-sync/simplefin-native.ts +201 -0
- package/src/plugins/broker-sync/simplefin.ts +70 -0
- package/src/plugins/builtin/account-management/footer.ts +8 -19
- package/src/plugins/builtin/account-management/pane.tsx +13 -8
- package/src/plugins/builtin/ai/pi/host.ts +6 -5
- package/src/plugins/builtin/ai/providers.ts +1 -1
- package/src/plugins/builtin/ai/screener/footer.ts +0 -7
- package/src/plugins/builtin/ai/screener/pane.test.tsx +2 -1
- package/src/plugins/builtin/ai/screener/pane.tsx +3 -1
- package/src/plugins/builtin/ai/screener/results-view.tsx +8 -0
- package/src/plugins/builtin/ai/screener/runner.ts +7 -3
- package/src/plugins/builtin/ai/workspace/pane.tsx +13 -2
- package/src/plugins/builtin/alerts/alert-engine.ts +13 -0
- package/src/plugins/builtin/alerts/constants.ts +2 -1
- package/src/plugins/builtin/alerts/index.tsx +67 -36
- package/src/plugins/builtin/alerts/pane.tsx +17 -65
- package/src/plugins/builtin/analytics/index.tsx +24 -11
- package/src/plugins/builtin/analytics/pane-model.ts +48 -14
- package/src/plugins/builtin/analytics/portfolio-selection.ts +19 -0
- package/src/plugins/builtin/analytics/view.tsx +5 -3
- package/src/plugins/builtin/broker-manager/detail.tsx +7 -2
- package/src/plugins/builtin/broker-manager/footer.ts +4 -9
- package/src/plugins/builtin/broker-manager/index.tsx +1 -6
- package/src/plugins/builtin/buildout/detail/ui.tsx +15 -4
- package/src/plugins/builtin/buildout/pane/header.tsx +1 -0
- package/src/plugins/builtin/changelog/index.tsx +60 -45
- package/src/plugins/builtin/chart-composer/catalog-inventory.test.ts +97 -0
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +366 -0
- package/src/plugins/builtin/chart-composer/chart-spec.ts +21 -1
- package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +307 -0
- package/src/plugins/builtin/chart-composer/editor/controller.ts +1 -1
- package/src/plugins/builtin/chart-composer/index.tsx +45 -5
- package/src/plugins/builtin/chart-composer/pane.tsx +7 -88
- package/src/plugins/builtin/chart-composer/presets.test.ts +48 -0
- package/src/plugins/builtin/chart-composer/presets.ts +69 -3
- package/src/plugins/builtin/chart-composer/quick-add.tsx +8 -5
- package/src/plugins/builtin/chart-composer/semantic.ts +18 -14
- package/src/plugins/builtin/chart-composer/series-catalog.test.ts +39 -0
- package/src/plugins/builtin/chart-composer/series-catalog.ts +104 -3
- package/src/plugins/builtin/chart-composer/shortcuts.test.ts +10 -10
- package/src/plugins/builtin/chart-composer/shortcuts.ts +4 -12
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +230 -23
- package/src/plugins/builtin/chat/chat.test.tsx +22 -0
- package/src/plugins/builtin/chat/content/composer.tsx +6 -4
- package/src/plugins/builtin/chat/content/index.tsx +7 -0
- package/src/plugins/builtin/chat/content/snapshot.ts +9 -2
- package/src/plugins/builtin/chat/content/transcript.tsx +10 -0
- package/src/plugins/builtin/chat/controller/channel-actions.ts +11 -1
- package/src/plugins/builtin/chat/controller/channels.ts +13 -3
- package/src/plugins/builtin/chat/controller/index.ts +61 -7
- package/src/plugins/builtin/chat/controller/lifecycle.ts +3 -0
- package/src/plugins/builtin/chat/controller/message-loading.ts +5 -1
- package/src/plugins/builtin/chat/controller/messages.ts +3 -1
- package/src/plugins/builtin/chat/controller/notifications.ts +32 -11
- package/src/plugins/builtin/chat/controller/state.ts +7 -0
- package/src/plugins/builtin/chat/controller/view.ts +1 -0
- package/src/plugins/builtin/chat/controller.test.ts +117 -28
- package/src/plugins/builtin/cloud/auth-commands.ts +18 -0
- package/src/plugins/builtin/cloud/device-signin-dialog.tsx +243 -0
- package/src/plugins/builtin/cloud/device-signin.test.ts +217 -0
- package/src/plugins/builtin/cloud/device-signin.ts +240 -0
- package/src/plugins/builtin/cloud/plugin.tsx +7 -1
- package/src/plugins/builtin/cloud-tweets/table.tsx +57 -10
- package/src/plugins/builtin/composite-plugins.ts +39 -5
- package/src/plugins/builtin/congress-trades/detail.tsx +2 -4
- package/src/plugins/builtin/congress-trades/footer.ts +7 -16
- package/src/plugins/builtin/congress-trades/pane.tsx +12 -20
- package/src/plugins/builtin/connections/index.ts +53 -0
- package/src/plugins/builtin/connections/pane.test.tsx +79 -0
- package/src/plugins/builtin/connections/pane.tsx +258 -0
- package/src/plugins/builtin/correlation/index.test.tsx +2 -1
- package/src/plugins/builtin/correlation/index.tsx +58 -19
- package/src/plugins/builtin/correlation/matrix/model.ts +18 -7
- package/src/plugins/builtin/correlation/relationship/pane.tsx +43 -19
- package/src/plugins/builtin/correlation/settings.ts +1 -1
- package/src/plugins/builtin/credit-conditions/client.test.ts +80 -0
- package/src/plugins/builtin/credit-conditions/client.ts +105 -0
- package/src/plugins/builtin/credit-conditions/index.test.tsx +111 -0
- package/src/plugins/builtin/credit-conditions/index.tsx +227 -0
- package/src/plugins/builtin/credit-conditions/model.test.ts +43 -0
- package/src/plugins/builtin/credit-conditions/model.ts +64 -0
- package/src/plugins/builtin/debug/index.tsx +11 -6
- package/src/plugins/builtin/dividend-yield/client.test.ts +58 -0
- package/src/plugins/builtin/dividend-yield/client.ts +252 -0
- package/src/plugins/builtin/dividend-yield/index.tsx +61 -0
- package/src/plugins/builtin/dividend-yield/model.ts +83 -0
- package/src/plugins/builtin/dividend-yield/pane.tsx +305 -0
- package/src/plugins/builtin/dividend-yield/types.ts +22 -0
- package/src/plugins/builtin/earnings/data/cache.test.ts +10 -7
- package/src/plugins/builtin/earnings/data/cache.ts +23 -9
- package/src/plugins/builtin/earnings/index.tsx +57 -6
- package/src/plugins/builtin/econ/calendar-model.test.ts +37 -3
- package/src/plugins/builtin/econ/calendar-model.ts +32 -26
- package/src/plugins/builtin/econ/fred-cache.test.ts +8 -1
- package/src/plugins/builtin/econ/fred-series-map.ts +18 -0
- package/src/plugins/builtin/econ/index.test.tsx +105 -0
- package/src/plugins/builtin/econ/index.tsx +95 -52
- package/src/plugins/builtin/fear-greed/cache.test.ts +18 -3
- package/src/plugins/builtin/fear-greed/cache.ts +18 -6
- package/src/plugins/builtin/fear-greed/charts.tsx +9 -2
- package/src/plugins/builtin/fear-greed/format.ts +0 -9
- package/src/plugins/builtin/fear-greed/pane.tsx +21 -21
- package/src/plugins/builtin/futures/contracts.ts +100 -0
- package/src/plugins/builtin/futures/index.tsx +298 -0
- package/src/plugins/builtin/futures/model.test.ts +129 -0
- package/src/plugins/builtin/futures/model.ts +136 -0
- package/src/plugins/builtin/futures/pane.test.tsx +239 -0
- package/src/plugins/builtin/futures/table.test.ts +155 -0
- package/src/plugins/builtin/futures/table.tsx +241 -0
- package/src/plugins/builtin/fx-matrix/index.tsx +160 -134
- package/src/plugins/builtin/fx-matrix/pairs.ts +12 -1
- package/src/plugins/builtin/fx-matrix/pane.test.tsx +109 -0
- package/src/plugins/builtin/help/components.tsx +1 -30
- package/src/plugins/builtin/help/index.tsx +5 -25
- package/src/plugins/builtin/holders/pane.tsx +17 -12
- package/src/plugins/builtin/holders/treemap.tsx +4 -2
- package/src/plugins/builtin/insider/index.tsx +20 -10
- package/src/plugins/builtin/ipo-calendar/cache.ts +101 -0
- package/src/plugins/builtin/ipo-calendar/client.test.ts +31 -0
- package/src/plugins/builtin/ipo-calendar/client.ts +296 -0
- package/src/plugins/builtin/ipo-calendar/index.tsx +65 -0
- package/src/plugins/builtin/ipo-calendar/model.ts +145 -0
- package/src/plugins/builtin/ipo-calendar/pane.tsx +328 -0
- package/src/plugins/builtin/ipo-calendar/types.ts +19 -0
- package/src/plugins/builtin/kelly-sizer/index.test.tsx +3 -3
- package/src/plugins/builtin/kelly-sizer/model.ts +8 -1
- package/src/plugins/builtin/kelly-sizer/pane.tsx +33 -15
- package/src/plugins/builtin/kelly-sizer/view.tsx +12 -5
- package/src/plugins/builtin/market-halts/client.ts +114 -0
- package/src/plugins/builtin/market-halts/index.tsx +29 -0
- package/src/plugins/builtin/market-halts/model.test.ts +187 -0
- package/src/plugins/builtin/market-halts/model.ts +291 -0
- package/src/plugins/builtin/market-halts/pane.tsx +256 -0
- package/src/plugins/builtin/market-heatmap/data.test.ts +1 -0
- package/src/plugins/builtin/market-heatmap/data.ts +12 -3
- package/src/plugins/builtin/market-heatmap/index.tsx +131 -46
- package/src/plugins/builtin/market-movers/index.tsx +145 -63
- package/src/plugins/builtin/market-movers/model.ts +19 -3
- package/src/plugins/builtin/market-movers/screener.test.ts +108 -0
- package/src/plugins/builtin/market-movers/screener.ts +168 -10
- package/src/plugins/builtin/news/index.tsx +78 -99
- package/src/plugins/builtin/news/wire/article-search.test.ts +72 -0
- package/src/plugins/builtin/news/wire/article-search.ts +140 -0
- package/src/plugins/builtin/news/wire/breaking/pane.tsx +18 -8
- package/src/plugins/builtin/news/wire/categories.ts +35 -0
- package/src/plugins/builtin/news/wire/default-feeds.ts +47 -1
- package/src/plugins/builtin/news/wire/feed-config.test.ts +10 -5
- package/src/plugins/builtin/news/wire/index.tsx +41 -4
- package/src/plugins/builtin/news/wire/industry-pane.tsx +38 -19
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +10 -5
- package/src/plugins/builtin/news/wire/news/footer.ts +1 -0
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +15 -6
- package/src/plugins/builtin/news/wire/news/query-presets.ts +16 -2
- package/src/plugins/builtin/news/wire/news/table.test.tsx +54 -0
- package/src/plugins/builtin/news/wire/news/table.tsx +111 -17
- package/src/plugins/builtin/notes/files.test.ts +18 -0
- package/src/plugins/builtin/notes/files.ts +10 -4
- package/src/plugins/builtin/notes/index.tsx +4 -1
- package/src/plugins/builtin/notes/quick-notes-pane.test.tsx +182 -0
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +74 -31
- package/src/plugins/builtin/notes/ticker-notes-tab.test.tsx +380 -0
- package/src/plugins/builtin/notes/ticker-notes-tab.tsx +97 -40
- package/src/plugins/builtin/options/calc-seed.test.ts +118 -0
- package/src/plugins/builtin/options/calc-seed.ts +52 -0
- package/src/plugins/builtin/options/footer.ts +4 -1
- package/src/plugins/builtin/options/index.tsx +22 -1
- package/src/plugins/builtin/options/live-quotes.ts +8 -0
- package/src/plugins/builtin/options/table.ts +3 -1
- package/src/plugins/builtin/options/view.test.tsx +5 -1
- package/src/plugins/builtin/options/view.tsx +112 -17
- package/src/plugins/builtin/options-calculator/index.tsx +35 -0
- package/src/plugins/builtin/options-calculator/model.test.ts +172 -0
- package/src/plugins/builtin/options-calculator/model.ts +273 -0
- package/src/plugins/builtin/options-calculator/pane.test.tsx +138 -0
- package/src/plugins/builtin/options-calculator/pane.tsx +218 -0
- package/src/plugins/builtin/plugin-module.test.ts +16 -2
- package/src/plugins/builtin/plugin-module.ts +5 -1
- package/src/plugins/builtin/polls/client.ts +57 -0
- package/src/plugins/builtin/polls/hooks.ts +20 -0
- package/src/plugins/builtin/polls/index.tsx +35 -0
- package/src/plugins/builtin/polls/normalize.test.ts +230 -0
- package/src/plugins/builtin/polls/normalize.ts +319 -0
- package/src/plugins/builtin/polls/pane.tsx +722 -0
- package/src/plugins/builtin/polls/types.ts +77 -0
- package/src/plugins/builtin/portfolio-list/header.tsx +15 -4
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +7 -3
- package/src/plugins/builtin/portfolio-list/pane/supplemental.ts +1 -1
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -0
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +2 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +40 -67
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +25 -19
- package/src/plugins/builtin/research/index.test.ts +6 -25
- package/src/plugins/builtin/research/index.tsx +11 -5
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +86 -26
- package/src/plugins/builtin/scanner/denied.tsx +31 -0
- package/src/plugins/builtin/scanner/feed.ts +94 -0
- package/src/plugins/builtin/scanner/flow-model.test.ts +85 -0
- package/src/plugins/builtin/scanner/flow-model.ts +133 -0
- package/src/plugins/builtin/scanner/flow-pane.tsx +197 -0
- package/src/plugins/builtin/scanner/hilo-bars.tsx +121 -0
- package/src/plugins/builtin/scanner/hilo-model.test.ts +44 -0
- package/src/plugins/builtin/scanner/hilo-model.ts +75 -0
- package/src/plugins/builtin/scanner/hilo-pane.tsx +165 -0
- package/src/plugins/builtin/scanner/index.ts +109 -0
- package/src/plugins/builtin/scanner/waiting.tsx +11 -0
- package/src/plugins/builtin/sec/index.tsx +11 -7
- package/src/plugins/builtin/sectors/index.tsx +105 -81
- package/src/plugins/builtin/sectors/move-bar.tsx +43 -0
- package/src/plugins/builtin/sectors/sector-data.ts +18 -0
- package/src/plugins/builtin/sectors/sector-model.ts +13 -15
- package/src/plugins/builtin/shared/auto-refresh.ts +51 -0
- package/src/plugins/builtin/shared/cloud-upgrade.ts +29 -5
- package/src/plugins/builtin/shared/pane-footer.ts +16 -3
- package/src/plugins/builtin/shared/screener-live-quotes.test.ts +91 -0
- package/src/plugins/builtin/shared/screener-live-quotes.ts +134 -0
- package/src/plugins/builtin/shared/table-pane.ts +1 -5
- package/src/plugins/builtin/shared/use-quote-board.test.tsx +211 -0
- package/src/plugins/builtin/shared/use-quote-board.ts +195 -0
- package/src/plugins/builtin/short-interest/client.ts +124 -0
- package/src/plugins/builtin/short-interest/index.tsx +62 -0
- package/src/plugins/builtin/short-interest/model.ts +113 -0
- package/src/plugins/builtin/short-interest/pane.tsx +252 -0
- package/src/plugins/builtin/short-interest/types.ts +9 -0
- package/src/plugins/builtin/substack/article-detail.tsx +15 -1
- package/src/plugins/builtin/substack/pane-footer.ts +3 -22
- package/src/plugins/builtin/substack/pane.tsx +1 -2
- package/src/plugins/builtin/thirteenf/api.ts +4 -1
- package/src/plugins/builtin/thirteenf/model.ts +2 -0
- package/src/plugins/builtin/thirteenf/pane.tsx +6 -2
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +10 -4
- package/src/plugins/builtin/ticker-detail/data-panes/provider-search.tsx +67 -11
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +15 -8
- package/src/plugins/builtin/ticker-detail/index.tsx +5 -21
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +72 -32
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +0 -10
- package/src/plugins/builtin/ticker-detail/pane.tsx +4 -1
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.test.tsx +70 -0
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +34 -26
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +96 -49
- package/src/plugins/builtin/ticker-detail/research-tabs.ts +32 -0
- package/src/plugins/builtin/ticker-research-backend-plugin.ts +2 -9
- package/src/plugins/builtin/ticker-research-plugin.ts +6 -0
- package/src/plugins/builtin/treasury-auctions/cache.test.ts +173 -0
- package/src/plugins/builtin/treasury-auctions/cache.ts +104 -0
- package/src/plugins/builtin/treasury-auctions/client.test.ts +181 -0
- package/src/plugins/builtin/treasury-auctions/client.ts +151 -0
- package/src/plugins/builtin/treasury-auctions/index.tsx +90 -0
- package/src/plugins/builtin/treasury-auctions/model.test.ts +147 -0
- package/src/plugins/builtin/treasury-auctions/model.ts +188 -0
- package/src/plugins/builtin/treasury-auctions/pane.test.tsx +170 -0
- package/src/plugins/builtin/treasury-auctions/pane.tsx +417 -0
- package/src/plugins/builtin/treasury-auctions/types.ts +59 -0
- package/src/plugins/builtin/tv/pane.tsx +67 -7
- package/src/plugins/builtin/tv/youtube-embed.test.ts +84 -0
- package/src/plugins/builtin/tv/youtube-embed.ts +173 -0
- package/src/plugins/builtin/tv/youtube-stream.ts +27 -2
- package/src/plugins/builtin/volatility/client.ts +87 -0
- package/src/plugins/builtin/volatility/index.test.tsx +107 -0
- package/src/plugins/builtin/volatility/index.tsx +193 -0
- package/src/plugins/builtin/volatility/model.test.ts +66 -0
- package/src/plugins/builtin/volatility/model.ts +113 -0
- package/src/plugins/builtin/world-indices/footer.ts +43 -23
- package/src/plugins/builtin/world-indices/index.tsx +44 -93
- package/src/plugins/builtin/world-indices/indices.ts +11 -2
- package/src/plugins/builtin/world-indices/model.ts +17 -24
- package/src/plugins/builtin/world-indices/pane.test.tsx +116 -0
- package/src/plugins/builtin/world-indices/table.tsx +82 -37
- package/src/plugins/builtin/yield-curve/index.tsx +16 -7
- package/src/plugins/builtin/yield-curve/treasury-data.test.ts +25 -0
- package/src/plugins/builtin/yield-curve/treasury-data.ts +16 -0
- package/src/plugins/catalog-backend.ts +8 -0
- package/src/plugins/catalog-ui.ts +8 -0
- package/src/plugins/event-bus.ts +1 -0
- package/src/plugins/ibkr/gateway/account-loaders.ts +1 -1
- package/src/plugins/ibkr/trade/tab/footer.ts +9 -23
- package/src/plugins/ibkr/trade/tab/index.tsx +1 -5
- package/src/plugins/ibkr/trading/pane-view.tsx +149 -87
- package/src/plugins/ibkr/trading/pane.tsx +2 -2
- package/src/plugins/ownership.ts +3 -0
- package/src/plugins/pane-manager/floating.ts +8 -2
- package/src/plugins/pane-manager.test.ts +13 -0
- package/src/plugins/prediction-markets/backend-plugin.ts +2 -0
- package/src/plugins/prediction-markets/capability.test.ts +281 -0
- package/src/plugins/prediction-markets/capability.ts +171 -0
- package/src/plugins/prediction-markets/chart.tsx +18 -26
- package/src/plugins/prediction-markets/columns.ts +3 -2
- package/src/plugins/prediction-markets/controller/catalog.ts +15 -12
- package/src/plugins/prediction-markets/controller/detail.ts +4 -0
- package/src/plugins/prediction-markets/controller/index.ts +0 -15
- package/src/plugins/prediction-markets/detail/book.tsx +3 -23
- package/src/plugins/prediction-markets/detail/overview.tsx +0 -18
- package/src/plugins/prediction-markets/detail/pane.tsx +36 -12
- package/src/plugins/prediction-markets/detail.test.tsx +1 -1
- package/src/plugins/prediction-markets/index.tsx +2 -0
- package/src/plugins/prediction-markets/metrics.ts +28 -18
- package/src/plugins/prediction-markets/navigation.ts +1 -0
- package/src/plugins/prediction-markets/pane.test.tsx +1 -1
- package/src/plugins/prediction-markets/pane.tsx +0 -1
- package/src/plugins/prediction-markets/services/fetch.ts +3 -2
- package/src/plugins/prediction-markets/services/kalshi/adapter.ts +82 -23
- package/src/plugins/prediction-markets/services/kalshi/normalize.ts +3 -1
- package/src/plugins/prediction-markets/services/kalshi/types.ts +14 -0
- package/src/plugins/prediction-markets/services/polymarket/adapter.ts +26 -14
- package/src/plugins/prediction-markets/services/polymarket/detail.ts +67 -18
- package/src/plugins/prediction-markets/test-helpers.tsx +0 -1
- package/src/plugins/prediction-markets/types.ts +3 -9
- package/src/plugins/registry/context.ts +6 -1
- package/src/plugins/registry/index.test.ts +2 -0
- package/src/plugins/registry/index.ts +53 -3
- package/src/plugins/runtime/context.tsx +4 -2
- package/src/plugins/runtime/index.tsx +9 -0
- package/src/remote/controller.test.ts +17 -4
- package/src/renderers/electrobun/bun/application-menu/index.ts +1 -1
- package/src/renderers/electrobun/bun/core-capabilities.ts +2 -2
- package/src/renderers/electrobun/bun/desktop/capability-bridge.test.ts +64 -0
- package/src/renderers/electrobun/bun/desktop/capability-bridge.ts +41 -7
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +5 -2
- package/src/renderers/electrobun/bun/desktop/http-fetch.test.ts +33 -0
- package/src/renderers/electrobun/bun/desktop/http-fetch.ts +53 -6
- package/src/renderers/electrobun/bun/desktop/initialization.test.ts +27 -0
- package/src/renderers/electrobun/bun/desktop/initialization.ts +6 -1
- package/src/renderers/electrobun/bun/index.ts +1 -0
- package/src/renderers/electrobun/shared/protocol.ts +2 -0
- package/src/renderers/electrobun/view/app-services.ts +25 -2
- package/src/renderers/electrobun/view/build-assets.ts +5 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +186 -65
- package/src/renderers/electrobun/view/cli-pane-shot-health.test.ts +25 -0
- package/src/renderers/electrobun/view/cli-pane-shot-health.ts +31 -0
- package/src/renderers/electrobun/view/data-table/index.tsx +10 -11
- package/src/renderers/electrobun/view/data-table/row.tsx +2 -0
- package/src/renderers/electrobun/view/desktop/controls.test.tsx +68 -0
- package/src/renderers/electrobun/view/desktop/controls.tsx +25 -1
- package/src/renderers/electrobun/view/host/box.test.tsx +80 -0
- package/src/renderers/electrobun/view/host/media-surface.tsx +70 -3
- package/src/renderers/electrobun/view/host/tabs.tsx +97 -5
- package/src/renderers/electrobun/view/host/text.tsx +5 -2
- package/src/renderers/electrobun/view/input-host.test.tsx +140 -0
- package/src/renderers/electrobun/view/input-host.tsx +4 -2
- package/src/renderers/electrobun/view/native-stubs/backend-rpc.ts +19 -1
- package/src/renderers/electrobun/view/native-stubs/broker-sync-native-loader.ts +7 -0
- package/src/renderers/electrobun/view/native-stubs/chart/kitty-support.ts +10 -0
- package/src/renderers/electrobun/view/remote/capability-invoker.test.ts +46 -0
- package/src/renderers/electrobun/view/remote/capability-invoker.ts +34 -13
- package/src/renderers/electrobun/view/remote/connection-health-backend.ts +19 -0
- package/src/renderers/electrobun/view/remote/connection-health.test.ts +44 -0
- package/src/renderers/electrobun/view/remote/connection-health.ts +49 -0
- package/src/renderers/electrobun/view/styles.css +5 -0
- package/src/renderers/opentui/dialog-host.tsx +279 -80
- package/src/renderers/opentui/host.tsx +15 -1
- package/src/renderers/opentui/terminal-media.test.ts +102 -0
- package/src/renderers/opentui/terminal-media.ts +142 -0
- package/src/renderers/opentui/test-utils.tsx +9 -6
- package/src/renderers/opentui/toast-host.tsx +136 -7
- package/src/renderers/opentui/ui-host.tsx +19 -3
- package/src/sources/provider-router/connection-health.test.ts +28 -0
- package/src/sources/provider-router/connection-health.ts +47 -0
- package/src/sources/provider-router/history.test.ts +53 -4
- package/src/sources/provider-router/history.ts +119 -14
- package/src/sources/provider-router/index.ts +12 -1
- package/src/sources/yahoo-finance/history.ts +2 -9
- package/src/sources/yahoo-finance/http.ts +1 -1
- package/src/sources/yahoo-finance/symbols.ts +1 -1
- package/src/sources/yahoo-finance/types.ts +19 -0
- package/src/state/app/context/index.test.tsx +101 -0
- package/src/state/app/context/index.tsx +10 -0
- package/src/state/config-save-scheduler.ts +1 -6
- package/src/state/persist-scheduler.test.ts +31 -0
- package/src/state/persist-scheduler.ts +21 -8
- package/src/sync/auth-transition.test.ts +36 -0
- package/src/sync/auth-transition.ts +22 -0
- package/src/sync/core-contributors.test.ts +58 -1
- package/src/sync/core-contributors.ts +39 -2
- package/src/sync/react.ts +9 -0
- package/src/test-support/plugin-runtime.ts +3 -0
- package/src/theme/font-scale.test.ts +14 -0
- package/src/theme/font-scale.ts +69 -0
- package/src/tickers/search/index.test.ts +284 -2
- package/src/tickers/search/index.ts +55 -18
- package/src/tickers/search/ranking.ts +143 -18
- package/src/tickers/search/types.ts +1 -0
- package/src/time-series/alignment.ts +15 -11
- package/src/time-series/field-catalog.ts +10 -0
- package/src/time-series/fundamentals.ts +19 -11
- package/src/time-series/hooks.ts +8 -2
- package/src/time-series/parsed-history-cache.ts +35 -0
- package/src/time-series/resolution.ts +10 -0
- package/src/time-series/resolve.test.ts +332 -3
- package/src/time-series/resolve.ts +225 -25
- package/src/time-series/spec-studies.test.ts +23 -0
- package/src/time-series/spec.ts +21 -2
- package/src/time-series/transforms.test.ts +76 -1
- package/src/time-series/transforms.ts +39 -8
- package/src/time-series/types.ts +9 -2
- package/src/time-series/use-chart-resolution.test.tsx +105 -1
- package/src/time-series/use-chart-resolution.ts +67 -13
- package/src/types/config.ts +30 -27
- package/src/types/media.ts +2 -0
- package/src/types/plugin.ts +8 -1
- package/src/ui/host.tsx +4 -0
- package/src/ui/pointer-drag.ts +12 -0
- package/src/ui/qr.test.ts +79 -0
- package/src/ui/qr.ts +82 -0
- package/src/updater/github-releases.test.ts +3 -3
- package/src/updater/github-releases.ts +1 -1
- package/src/updater.test.ts +117 -16
- package/src/updater.ts +32 -5
- package/src/utils/exchanges.ts +1 -0
- package/src/utils/external-url.test.ts +32 -0
- package/src/utils/external-url.ts +23 -0
- package/src/utils/sort-values.ts +31 -0
- package/src/utils/zoned-date-time.ts +67 -0
- package/src/components/onboarding/wizard-keyboard.ts +0 -306
- package/src/plugins/builtin/chart-composer/date-window-dialog.tsx +0 -120
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { Box, TextAttributes, useUiCapabilities } from "../../../ui";
|
|
3
|
+
import {
|
|
4
|
+
DataTableView,
|
|
5
|
+
EmptyState,
|
|
6
|
+
Spinner,
|
|
7
|
+
StaticChartSurface,
|
|
8
|
+
unavailableText,
|
|
9
|
+
usePaneFooter,
|
|
10
|
+
usePaneTicker,
|
|
11
|
+
type DataTableCell,
|
|
12
|
+
type DataTableKeyEvent,
|
|
13
|
+
} from "../../../components";
|
|
14
|
+
import { resolveChartPalette } from "../../../components/chart/core/renderer";
|
|
15
|
+
import type { ProjectedChartPoint } from "../../../components/chart/core/data";
|
|
16
|
+
import { colors, blendHex } from "../../../theme/colors";
|
|
17
|
+
import { useShortcut } from "../../../react/input";
|
|
18
|
+
import { isPlainKey } from "../../../utils/keyboard";
|
|
19
|
+
import { formatCompact } from "../../../utils/format";
|
|
20
|
+
import { usePluginPaneState } from "../../runtime";
|
|
21
|
+
import { isUsEquityTicker } from "../../../utils/sec";
|
|
22
|
+
import type { TickerRecord } from "../../../types/ticker";
|
|
23
|
+
import { fetchShortInterest } from "./client";
|
|
24
|
+
import {
|
|
25
|
+
buildColumns,
|
|
26
|
+
buildRows,
|
|
27
|
+
DEFAULT_SORT,
|
|
28
|
+
nextSortPreference,
|
|
29
|
+
sortRows,
|
|
30
|
+
type ShortInterestColumn,
|
|
31
|
+
type ShortInterestRow,
|
|
32
|
+
type SortPreference,
|
|
33
|
+
} from "./model";
|
|
34
|
+
import type { LoadStatus, ShortInterestRecord } from "./types";
|
|
35
|
+
|
|
36
|
+
function hasClassifiableUsEquityMetadata(ticker: TickerRecord): boolean {
|
|
37
|
+
const contract = ticker.metadata.broker_contracts?.[0];
|
|
38
|
+
const currency = (contract?.currency ?? ticker.metadata.currency ?? "").trim();
|
|
39
|
+
const type = (contract?.secType ?? ticker.metadata.assetCategory ?? "").trim();
|
|
40
|
+
return currency.length > 0
|
|
41
|
+
|| type.length > 0
|
|
42
|
+
|| [contract?.primaryExchange, contract?.exchange, ticker.metadata.exchange]
|
|
43
|
+
.some((value) => (value ?? "").trim().length > 0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function recordsToChartPoints(records: ShortInterestRecord[]): ProjectedChartPoint[] {
|
|
47
|
+
return records.map((record) => ({
|
|
48
|
+
date: record.settlementDate,
|
|
49
|
+
open: record.sharesShort,
|
|
50
|
+
high: record.sharesShort,
|
|
51
|
+
low: record.sharesShort,
|
|
52
|
+
close: record.sharesShort,
|
|
53
|
+
volume: 0,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function ShortInterestView({ width, height, focused }: { width: number; height: number; focused: boolean }) {
|
|
58
|
+
const { nativePaneChrome } = useUiCapabilities();
|
|
59
|
+
const { ticker } = usePaneTicker();
|
|
60
|
+
const symbol = ticker?.metadata.ticker ?? null;
|
|
61
|
+
|
|
62
|
+
const [records, setRecords] = useState<ShortInterestRecord[]>([]);
|
|
63
|
+
const [status, setStatus] = useState<LoadStatus>("idle");
|
|
64
|
+
const [error, setError] = useState<string | null>(null);
|
|
65
|
+
const [sortPreference, setSortPreference] = usePluginPaneState<SortPreference>(
|
|
66
|
+
"short-interest:sort",
|
|
67
|
+
DEFAULT_SORT,
|
|
68
|
+
);
|
|
69
|
+
const [selectedIdx, setSelectedIdx] = useState(0);
|
|
70
|
+
const fetchGenRef = useRef(0);
|
|
71
|
+
|
|
72
|
+
const rows = useMemo(() => buildRows(records), [records]);
|
|
73
|
+
const sortedRows = useMemo(() => sortRows(rows, sortPreference), [rows, sortPreference]);
|
|
74
|
+
const columns = useMemo(() => buildColumns(width), [width]);
|
|
75
|
+
const chartPoints = useMemo(() => recordsToChartPoints(records), [records]);
|
|
76
|
+
|
|
77
|
+
const boundedSelectedIdx = sortedRows.length > 0
|
|
78
|
+
? Math.min(selectedIdx, sortedRows.length - 1)
|
|
79
|
+
: -1;
|
|
80
|
+
|
|
81
|
+
const skipNonUs = !!(ticker && hasClassifiableUsEquityMetadata(ticker) && !isUsEquityTicker(ticker));
|
|
82
|
+
|
|
83
|
+
const loadData = useCallback(async () => {
|
|
84
|
+
if (!symbol) {
|
|
85
|
+
setRecords([]);
|
|
86
|
+
setStatus("idle");
|
|
87
|
+
setError(null);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (skipNonUs) {
|
|
91
|
+
setRecords([]);
|
|
92
|
+
setStatus("loaded");
|
|
93
|
+
setError(null);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
fetchGenRef.current += 1;
|
|
98
|
+
const gen = fetchGenRef.current;
|
|
99
|
+
setStatus((current) => (current === "loaded" ? current : "loading"));
|
|
100
|
+
setError(null);
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
const data = await fetchShortInterest(symbol);
|
|
104
|
+
if (fetchGenRef.current !== gen) return;
|
|
105
|
+
setRecords(data);
|
|
106
|
+
setStatus("loaded");
|
|
107
|
+
setSelectedIdx(0);
|
|
108
|
+
} catch (err) {
|
|
109
|
+
if (fetchGenRef.current !== gen) return;
|
|
110
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
111
|
+
setRecords([]);
|
|
112
|
+
setStatus("error");
|
|
113
|
+
}
|
|
114
|
+
}, [skipNonUs, symbol]);
|
|
115
|
+
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
void loadData();
|
|
118
|
+
}, [loadData]);
|
|
119
|
+
|
|
120
|
+
const refresh = useCallback(() => {
|
|
121
|
+
void loadData();
|
|
122
|
+
}, [loadData]);
|
|
123
|
+
|
|
124
|
+
const handleHeaderClick = useCallback((columnId: string) => {
|
|
125
|
+
setSortPreference((current) => nextSortPreference(current, columnId));
|
|
126
|
+
}, [setSortPreference]);
|
|
127
|
+
|
|
128
|
+
const handleKeyDown = useCallback((event: DataTableKeyEvent) => {
|
|
129
|
+
if (event.name === "r") {
|
|
130
|
+
event.preventDefault?.();
|
|
131
|
+
event.stopPropagation?.();
|
|
132
|
+
refresh();
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}, [refresh]);
|
|
137
|
+
|
|
138
|
+
useShortcut((event) => {
|
|
139
|
+
if (!focused) return;
|
|
140
|
+
if (isPlainKey(event, "r")) {
|
|
141
|
+
event.preventDefault?.();
|
|
142
|
+
event.stopPropagation?.();
|
|
143
|
+
refresh();
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const renderCell = useCallback((
|
|
148
|
+
row: ShortInterestRow,
|
|
149
|
+
column: ShortInterestColumn,
|
|
150
|
+
_index: number,
|
|
151
|
+
rowState: { selected: boolean },
|
|
152
|
+
): DataTableCell => {
|
|
153
|
+
const selectedColor = rowState.selected ? colors.selectedText : undefined;
|
|
154
|
+
switch (column.id) {
|
|
155
|
+
case "settlementDate":
|
|
156
|
+
return { text: row.settlementDate, color: selectedColor ?? colors.textDim };
|
|
157
|
+
case "sharesShort":
|
|
158
|
+
return { text: row.sharesShort, color: selectedColor ?? colors.textBright, attributes: TextAttributes.BOLD };
|
|
159
|
+
case "shortRatio":
|
|
160
|
+
return { text: row.shortRatio, color: selectedColor ?? colors.text };
|
|
161
|
+
case "averageDailyVolume":
|
|
162
|
+
return { text: row.averageDailyVolume, color: selectedColor ?? colors.textDim };
|
|
163
|
+
case "shortPercentFloat":
|
|
164
|
+
return { text: row.shortPercentFloat, color: selectedColor ?? colors.text };
|
|
165
|
+
}
|
|
166
|
+
}, []);
|
|
167
|
+
|
|
168
|
+
usePaneFooter("short-interest", () => ({
|
|
169
|
+
info: [
|
|
170
|
+
...(status === "loading" ? [{ id: "loading", parts: [{ text: "loading", tone: "muted" as const }] }] : []),
|
|
171
|
+
...(status === "error" && error ? [{ id: "error", parts: [{ text: error.slice(0, 60), tone: "warning" as const }] }] : []),
|
|
172
|
+
],
|
|
173
|
+
}), [error, status]);
|
|
174
|
+
|
|
175
|
+
if (!ticker || !symbol) {
|
|
176
|
+
return <EmptyState title="No ticker selected." message="Select a ticker to view short interest." />;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if ((status === "idle" || status === "loading") && records.length === 0) {
|
|
180
|
+
return <Spinner label="Loading short interest..." />;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (status === "error" && records.length === 0) {
|
|
184
|
+
return <EmptyState title={unavailableText("Short interest")} message={error ?? undefined} />;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (status === "loaded" && records.length === 0) {
|
|
188
|
+
const usEquitiesOnly = hasClassifiableUsEquityMetadata(ticker) && !isUsEquityTicker(ticker);
|
|
189
|
+
return (
|
|
190
|
+
<EmptyState
|
|
191
|
+
title={usEquitiesOnly ? "US equities only" : "No short interest data"}
|
|
192
|
+
message={usEquitiesOnly
|
|
193
|
+
? "Short interest data is available for US equities."
|
|
194
|
+
: `No short interest found for ${symbol}.`}
|
|
195
|
+
/>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const showChart = chartPoints.length >= 2;
|
|
200
|
+
const chartHeight = showChart ? Math.max(1, Math.floor((height - 1) * 0.35)) : 0;
|
|
201
|
+
const tableHeight = Math.max(1, height - chartHeight - 1 - (nativePaneChrome ? 1 : 0));
|
|
202
|
+
const chartWidth = Math.max(24, width - 2);
|
|
203
|
+
const palette = {
|
|
204
|
+
...resolveChartPalette(colors, "neutral"),
|
|
205
|
+
lineColor: colors.warning,
|
|
206
|
+
fillColor: blendHex(colors.bg, colors.warning, 0.18),
|
|
207
|
+
gridColor: blendHex(colors.bg, colors.border, 0.55),
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
return (
|
|
211
|
+
<Box flexDirection="column" width={width} height={height}>
|
|
212
|
+
{showChart ? (
|
|
213
|
+
<Box flexDirection="column" marginTop={1} paddingX={1} flexShrink={0}>
|
|
214
|
+
<StaticChartSurface
|
|
215
|
+
points={chartPoints}
|
|
216
|
+
width={chartWidth}
|
|
217
|
+
height={chartHeight}
|
|
218
|
+
mode="line"
|
|
219
|
+
colors={palette}
|
|
220
|
+
showTimeAxis
|
|
221
|
+
timeAxisColor={colors.textDim}
|
|
222
|
+
yAxisColor={colors.textDim}
|
|
223
|
+
formatYAxisValue={(value: number) => formatCompact(value)}
|
|
224
|
+
/>
|
|
225
|
+
</Box>
|
|
226
|
+
) : null}
|
|
227
|
+
<Box flexGrow={1} marginTop={chartPoints.length >= 2 ? 1 : 0}>
|
|
228
|
+
<DataTableView<ShortInterestRow, ShortInterestColumn>
|
|
229
|
+
focused={focused}
|
|
230
|
+
selection={{
|
|
231
|
+
kind: "index",
|
|
232
|
+
selectedIndex: boundedSelectedIdx,
|
|
233
|
+
onChange: (index) => setSelectedIdx(index),
|
|
234
|
+
}}
|
|
235
|
+
onRootKeyDown={handleKeyDown}
|
|
236
|
+
rootWidth={width}
|
|
237
|
+
rootHeight={tableHeight}
|
|
238
|
+
columns={columns}
|
|
239
|
+
items={sortedRows}
|
|
240
|
+
sortColumnId={sortPreference.columnId}
|
|
241
|
+
sortDirection={sortPreference.direction}
|
|
242
|
+
onHeaderClick={handleHeaderClick}
|
|
243
|
+
getItemKey={(row) => row.key}
|
|
244
|
+
renderCell={renderCell}
|
|
245
|
+
emptyStateTitle={status === "loading" ? "Loading..." : "No data"}
|
|
246
|
+
/>
|
|
247
|
+
</Box>
|
|
248
|
+
</Box>
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export { ShortInterestView };
|
|
@@ -5,6 +5,7 @@ import { RemoteImage } from "../../../components/ui";
|
|
|
5
5
|
import { TickerBadgeText } from "../../../components/ticker/badge/text";
|
|
6
6
|
import { useInlineTickers } from "../../../state/hooks/inline-tickers";
|
|
7
7
|
import { colors } from "../../../theme/colors";
|
|
8
|
+
import { formatReadTime, formatWordCount } from "./table";
|
|
8
9
|
import type {
|
|
9
10
|
SubstackArticleDetail,
|
|
10
11
|
SubstackArticleSummary,
|
|
@@ -253,7 +254,10 @@ function ArticleBlockView({
|
|
|
253
254
|
</Box>
|
|
254
255
|
);
|
|
255
256
|
case "divider":
|
|
256
|
-
|
|
257
|
+
// A real filled rule in both renderers instead of a row of hyphens.
|
|
258
|
+
return (
|
|
259
|
+
<Box height={1} width={Math.max(1, Math.min(lineWidth, 96))} backgroundColor={colors.border} />
|
|
260
|
+
);
|
|
257
261
|
case "paragraph":
|
|
258
262
|
default:
|
|
259
263
|
return (
|
|
@@ -361,6 +365,16 @@ export const ArticleDetail = memo(function ArticleDetail({
|
|
|
361
365
|
return (
|
|
362
366
|
<ScrollBox ref={scrollRef} scrollY focusable={false} flexGrow={1} paddingX={1}>
|
|
363
367
|
<Box flexDirection="column" width={lineWidth} gap={1}>
|
|
368
|
+
{/* The stack title already names the article, so the body opens on its metadata. */}
|
|
369
|
+
<Box height={1}>
|
|
370
|
+
<Text fg={colors.textDim}>
|
|
371
|
+
{[
|
|
372
|
+
article.publicationName,
|
|
373
|
+
formatReadTime(resolved?.readMinutes ?? article.readMinutes),
|
|
374
|
+
formatWordCount(resolved?.wordCount ?? article.wordCount),
|
|
375
|
+
].filter(Boolean).join(" · ")}
|
|
376
|
+
</Text>
|
|
377
|
+
</Box>
|
|
364
378
|
{loading && !resolved ? <Spinner label="Loading article..." /> : null}
|
|
365
379
|
{error ? <Text fg={colors.negative}>{error}</Text> : null}
|
|
366
380
|
<ArticleRichContent
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { usePaneFooter } from "../../../components";
|
|
2
2
|
import type { SubstackAuthState } from "./api/types";
|
|
3
|
-
import {
|
|
4
|
-
formatReadTime,
|
|
5
|
-
formatWordCount,
|
|
6
|
-
} from "./table";
|
|
7
3
|
import {
|
|
8
4
|
SUBSTACK_PANE_ID,
|
|
9
5
|
type SubstackArticleSummary,
|
|
@@ -16,7 +12,6 @@ export function useSubstackPaneFooter({
|
|
|
16
12
|
activeFeedState,
|
|
17
13
|
activeDetail,
|
|
18
14
|
selectedArticle,
|
|
19
|
-
refreshActive,
|
|
20
15
|
openSelectedArticle,
|
|
21
16
|
}: {
|
|
22
17
|
auth: SubstackAuthState | null;
|
|
@@ -24,47 +19,33 @@ export function useSubstackPaneFooter({
|
|
|
24
19
|
activeFeedState: ActiveFeedState;
|
|
25
20
|
activeDetail: DetailState;
|
|
26
21
|
selectedArticle: SubstackArticleSummary | null;
|
|
27
|
-
refreshActive: () => void;
|
|
28
22
|
openSelectedArticle: () => void;
|
|
29
23
|
}) {
|
|
30
24
|
const statusLabel = cacheStatusLabel(activeFeedState.fetchedAt, activeFeedState.stale);
|
|
31
|
-
const articleMetaLabel = detailOpen && selectedArticle
|
|
32
|
-
? [
|
|
33
|
-
selectedArticle.publicationName,
|
|
34
|
-
formatReadTime(activeDetail.data?.readMinutes ?? selectedArticle.readMinutes),
|
|
35
|
-
formatWordCount(activeDetail.data?.wordCount ?? selectedArticle.wordCount),
|
|
36
|
-
].filter(Boolean).join(" | ")
|
|
37
|
-
: null;
|
|
38
25
|
|
|
39
26
|
usePaneFooter(SUBSTACK_PANE_ID, () => ({
|
|
40
27
|
info: [
|
|
41
28
|
...(!auth ? [{ id: "auth", parts: [{ text: "login required", tone: "warning" as const }] }] : []),
|
|
42
|
-
...(articleMetaLabel ? [{ id: "article-meta", parts: [{ text: articleMetaLabel, tone: "muted" as const }] }] : []),
|
|
43
29
|
...(activeFeedState.loading || activeFeedState.loadingMore ? [{ id: "loading", parts: [{ text: activeFeedState.loadingMore ? "loading more" : "loading", tone: "muted" as const }] }] : []),
|
|
44
30
|
...(activeDetail.loading && detailOpen ? [{ id: "detail-loading", parts: [{ text: "loading article", tone: "muted" as const }] }] : []),
|
|
45
31
|
...(statusLabel && auth ? [{ id: "cache", parts: [{ text: statusLabel, tone: activeFeedState.stale ? "warning" as const : "muted" as const }] }] : []),
|
|
46
32
|
...(activeFeedState.error ? [{ id: "error", parts: [{ text: activeFeedState.error, tone: "warning" as const }] }] : []),
|
|
47
33
|
...(activeDetail.error && detailOpen ? [{ id: "detail-error", parts: [{ text: activeDetail.error, tone: "warning" as const }] }] : []),
|
|
48
34
|
],
|
|
49
|
-
hints: auth
|
|
50
|
-
{ id: "
|
|
51
|
-
|
|
52
|
-
] : [],
|
|
35
|
+
hints: auth
|
|
36
|
+
? [{ id: "open", key: "o", label: "pen", onPress: openSelectedArticle, disabled: !selectedArticle?.url }]
|
|
37
|
+
: [],
|
|
53
38
|
}), [
|
|
54
39
|
activeDetail.error,
|
|
55
40
|
activeDetail.loading,
|
|
56
|
-
activeDetail.data?.readMinutes,
|
|
57
|
-
activeDetail.data?.wordCount,
|
|
58
41
|
activeFeedState.error,
|
|
59
42
|
activeFeedState.fetchedAt,
|
|
60
43
|
activeFeedState.loading,
|
|
61
44
|
activeFeedState.loadingMore,
|
|
62
45
|
activeFeedState.stale,
|
|
63
|
-
articleMetaLabel,
|
|
64
46
|
auth,
|
|
65
47
|
detailOpen,
|
|
66
48
|
openSelectedArticle,
|
|
67
|
-
refreshActive,
|
|
68
49
|
selectedArticle?.url,
|
|
69
50
|
statusLabel,
|
|
70
51
|
]);
|
|
@@ -411,7 +411,6 @@ export function SubstackPane({ focused, width, height }: PaneProps) {
|
|
|
411
411
|
activeFeedState,
|
|
412
412
|
activeDetail,
|
|
413
413
|
selectedArticle,
|
|
414
|
-
refreshActive,
|
|
415
414
|
openSelectedArticle,
|
|
416
415
|
});
|
|
417
416
|
|
|
@@ -452,7 +451,7 @@ export function SubstackPane({ focused, width, height }: PaneProps) {
|
|
|
452
451
|
<Box flexDirection="column" width={width} height={height}>
|
|
453
452
|
{tabs}
|
|
454
453
|
<Box padding={1}>
|
|
455
|
-
<EmptyState title="Substack unavailable." message={home.error}
|
|
454
|
+
<EmptyState title="Substack unavailable." message={home.error} />
|
|
456
455
|
</Box>
|
|
457
456
|
</Box>
|
|
458
457
|
);
|
|
@@ -11,7 +11,10 @@ import { httpFetch } from "../../../utils/http-transport";
|
|
|
11
11
|
|
|
12
12
|
const FORMS_13F_BASE_URL = "https://forms13f.com/api/v1";
|
|
13
13
|
const FORM_PAGE_LIMIT = 100;
|
|
14
|
-
|
|
14
|
+
// ponytail: large funds file well past 2,000 positions, and a silently clipped
|
|
15
|
+
// list makes every weight, total, and buy/sell action wrong. Paging further is
|
|
16
|
+
// slower but truthful; page in parallel if the wait becomes the problem.
|
|
17
|
+
const MAX_FORM_ROWS = 20_000;
|
|
15
18
|
const CACHE_KIND = "forms13f-api";
|
|
16
19
|
const CACHE_SOURCE = "forms13f";
|
|
17
20
|
const CACHE_SCHEMA_VERSION = 1;
|
|
@@ -58,6 +58,8 @@ const CIK_RE = /^\d{6,10}$/;
|
|
|
58
58
|
export function inferBrowserTabFromQuery(query: string): ThirteenFBrowserTab {
|
|
59
59
|
const trimmed = query.trim();
|
|
60
60
|
if (!trimmed) return "performance";
|
|
61
|
+
// The recent-filings feed has no tab of its own; this keyword is how it is reached.
|
|
62
|
+
if (/^(latest|recent)$/i.test(trimmed)) return "latest";
|
|
61
63
|
if (!/[a-z]/.test(trimmed) && TICKER_LIKE_RE.test(trimmed.replace(/^\$/, "").toUpperCase())) return "byTicker";
|
|
62
64
|
return "funds";
|
|
63
65
|
}
|
|
@@ -277,6 +277,9 @@ export function ThirteenFPane({ focused, width, height }: PaneProps) {
|
|
|
277
277
|
loading: status === "loading",
|
|
278
278
|
error,
|
|
279
279
|
info: browserStatusInfo,
|
|
280
|
+
hints: [
|
|
281
|
+
{ id: "search", key: "/", label: "search", onPress: focusSearch },
|
|
282
|
+
],
|
|
280
283
|
});
|
|
281
284
|
|
|
282
285
|
const rootBefore = (
|
|
@@ -288,7 +291,7 @@ export function ThirteenFPane({ focused, width, height }: PaneProps) {
|
|
|
288
291
|
width={width}
|
|
289
292
|
focusToken={searchFocusToken}
|
|
290
293
|
inputRef={searchInputRef}
|
|
291
|
-
placeholder="fund, ticker, or
|
|
294
|
+
placeholder="fund, ticker, CIK, or latest"
|
|
292
295
|
debounceMs={SEARCH_DEBOUNCE_MS}
|
|
293
296
|
normalizeValue={trimSearchValue}
|
|
294
297
|
onFocus={focusSearch}
|
|
@@ -542,6 +545,7 @@ function FundDetailView({
|
|
|
542
545
|
loading: status === "loading",
|
|
543
546
|
error,
|
|
544
547
|
info: detailStatusInfo,
|
|
548
|
+
showOpenHint: true,
|
|
545
549
|
});
|
|
546
550
|
|
|
547
551
|
if ((status === "loading" || status === "idle") && !data) {
|
|
@@ -558,7 +562,7 @@ function FundDetailView({
|
|
|
558
562
|
return (
|
|
559
563
|
<Box flexDirection="column" width={width} flexGrow={1} overflow="hidden">
|
|
560
564
|
<Box padding={1}>
|
|
561
|
-
<EmptyState title="13F fund unavailable." message={error ?? "Failed to load fund."}
|
|
565
|
+
<EmptyState title="13F fund unavailable." message={error ?? "Failed to load fund."} />
|
|
562
566
|
</Box>
|
|
563
567
|
</Box>
|
|
564
568
|
);
|
|
@@ -2,6 +2,8 @@ import { useCallback, useMemo } from "react";
|
|
|
2
2
|
import { TextAttributes } from "../../../../ui";
|
|
3
3
|
import {
|
|
4
4
|
DataTableView,
|
|
5
|
+
loadingText,
|
|
6
|
+
unavailableText,
|
|
5
7
|
usePaneFooter,
|
|
6
8
|
type DataTableCell,
|
|
7
9
|
type DataTableColumn,
|
|
@@ -17,7 +19,7 @@ import {
|
|
|
17
19
|
useDebouncedPluginPaneState,
|
|
18
20
|
usePluginPaneState,
|
|
19
21
|
} from "../../../runtime";
|
|
20
|
-
import { loadingErrorFooterInfo,
|
|
22
|
+
import { loadingErrorFooterInfo, useClampSelectedIndex } from "../../shared/table-pane";
|
|
21
23
|
import { formatDateTime, useBoundTicker, useTickerRequest } from "../../shared/ticker-request";
|
|
22
24
|
|
|
23
25
|
type HistoryColumnId = "date" | "open" | "high" | "low" | "close" | "change" | "changePercent" | "volume";
|
|
@@ -165,9 +167,8 @@ export function HistoricalPricesPane({ focused, width, height }: PaneProps) {
|
|
|
165
167
|
],
|
|
166
168
|
hints: [
|
|
167
169
|
{ id: "range", key: "t", label: "oggle range", onPress: cycleRange },
|
|
168
|
-
refreshFooterHint(reload),
|
|
169
170
|
],
|
|
170
|
-
}), [cycleRange, error, loading, range
|
|
171
|
+
}), [cycleRange, error, loading, range]);
|
|
171
172
|
|
|
172
173
|
return (
|
|
173
174
|
<DataTableView<HistoricalPriceRow, HistoryColumn>
|
|
@@ -187,7 +188,12 @@ export function HistoricalPricesPane({ focused, width, height }: PaneProps) {
|
|
|
187
188
|
onHeaderClick={() => {}}
|
|
188
189
|
getItemKey={(row) => row.key}
|
|
189
190
|
renderCell={renderCell}
|
|
190
|
-
emptyStateTitle={
|
|
191
|
+
emptyStateTitle={error
|
|
192
|
+
? unavailableText("Historical prices")
|
|
193
|
+
: loading
|
|
194
|
+
? loadingText("historical prices")
|
|
195
|
+
: "No historical prices"}
|
|
196
|
+
emptyStateHint={error ?? undefined}
|
|
191
197
|
/>
|
|
192
198
|
);
|
|
193
199
|
}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
-
import { TextAttributes } from "../../../../ui";
|
|
2
|
+
import { TextAttributes, type InputRenderable } from "../../../../ui";
|
|
3
3
|
import {
|
|
4
4
|
DataTableView,
|
|
5
|
+
InputSearchBar,
|
|
6
|
+
loadingText,
|
|
7
|
+
unavailableText,
|
|
5
8
|
usePaneFooter,
|
|
6
9
|
type DataTableCell,
|
|
7
10
|
type DataTableColumn,
|
|
8
11
|
type DataTableKeyEvent,
|
|
9
12
|
} from "../../../../components";
|
|
13
|
+
import { useShortcut } from "../../../../react/input";
|
|
14
|
+
import { isPlainKey } from "../../../../utils/keyboard";
|
|
10
15
|
import type { PaneProps, PaneTemplateDef } from "../../../../types/plugin";
|
|
11
16
|
import { TICKER_RESEARCH_PANE_ID } from "../../../../types/config";
|
|
12
17
|
import type { InstrumentSearchResult } from "../../../../types/instrument";
|
|
13
18
|
import { usePaneInstance } from "../../../../state/app/context";
|
|
14
19
|
import { colors } from "../../../../theme/colors";
|
|
15
20
|
import { useAssetData, usePluginPaneState, usePluginTickerActions } from "../../../runtime";
|
|
16
|
-
import { handleRefreshKey, loadingErrorFooterInfo,
|
|
21
|
+
import { handleRefreshKey, loadingErrorFooterInfo, useClampSelectedIndex } from "../../shared/table-pane";
|
|
17
22
|
import type { LoadState } from "../../shared/ticker-request";
|
|
18
23
|
|
|
24
|
+
const SEARCH_DEBOUNCE_MS = 250;
|
|
25
|
+
|
|
19
26
|
function resultSymbol(result: InstrumentSearchResult): string {
|
|
20
27
|
return result.symbol.trim().toUpperCase();
|
|
21
28
|
}
|
|
@@ -41,9 +48,13 @@ function buildSearchColumns(width: number): Array<DataTableColumn & { id: "symbo
|
|
|
41
48
|
|
|
42
49
|
export function ProviderSearchPane({ focused, width, height }: PaneProps) {
|
|
43
50
|
const dataProvider = useAssetData();
|
|
44
|
-
const
|
|
51
|
+
const initialQuery = useSearchQuerySetting();
|
|
45
52
|
const { pinTicker } = usePluginTickerActions();
|
|
53
|
+
const [query, setQuery] = usePluginPaneState<string>("query", initialQuery);
|
|
46
54
|
const [selectedIdx, setSelectedIdx] = usePluginPaneState<number>("selectedIdx", 0);
|
|
55
|
+
const [searchFocused, setSearchFocused] = useState(false);
|
|
56
|
+
const [searchFocusToken, setSearchFocusToken] = useState(0);
|
|
57
|
+
const searchInputRef = useRef<InputRenderable | null>(null);
|
|
47
58
|
const [state, setState] = useState<LoadState<InstrumentSearchResult[]>>({
|
|
48
59
|
data: null,
|
|
49
60
|
loading: false,
|
|
@@ -87,9 +98,33 @@ export function ProviderSearchPane({ focused, width, height }: PaneProps) {
|
|
|
87
98
|
|
|
88
99
|
useClampSelectedIndex(rows.length, selectedIdx, setSelectedIdx);
|
|
89
100
|
|
|
101
|
+
const focusSearch = useCallback(() => {
|
|
102
|
+
setSearchFocused(true);
|
|
103
|
+
setSearchFocusToken((token) => token + 1);
|
|
104
|
+
}, []);
|
|
105
|
+
const blurSearch = useCallback(() => setSearchFocused(false), []);
|
|
106
|
+
const updateQuery = useCallback((nextQuery: string) => {
|
|
107
|
+
setQuery(nextQuery.trim());
|
|
108
|
+
setSelectedIdx(0);
|
|
109
|
+
}, [setQuery, setSelectedIdx]);
|
|
110
|
+
|
|
90
111
|
const handleKeyDown = useCallback((event: DataTableKeyEvent) => {
|
|
112
|
+
if (isPlainKey(event, "/")) {
|
|
113
|
+
event.preventDefault?.();
|
|
114
|
+
event.stopPropagation?.();
|
|
115
|
+
focusSearch();
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
91
118
|
return handleRefreshKey(event, () => load(true));
|
|
92
|
-
}, [load]);
|
|
119
|
+
}, [focusSearch, load]);
|
|
120
|
+
|
|
121
|
+
useShortcut((event) => {
|
|
122
|
+
if (!focused || searchFocused || event.targetEditable) return;
|
|
123
|
+
if (!isPlainKey(event, "/")) return;
|
|
124
|
+
event.preventDefault?.();
|
|
125
|
+
event.stopPropagation?.();
|
|
126
|
+
focusSearch();
|
|
127
|
+
}, { allowEditable: true, enabled: focused });
|
|
93
128
|
|
|
94
129
|
const renderCell = useCallback((
|
|
95
130
|
row: InstrumentSearchResult,
|
|
@@ -111,16 +146,32 @@ export function ProviderSearchPane({ focused, width, height }: PaneProps) {
|
|
|
111
146
|
}, []);
|
|
112
147
|
|
|
113
148
|
usePaneFooter("provider-search", () => ({
|
|
114
|
-
info:
|
|
115
|
-
|
|
116
|
-
|
|
149
|
+
info: loadingErrorFooterInfo(state.loading, state.error),
|
|
150
|
+
hints: [
|
|
151
|
+
{ id: "search", key: "/", label: "search", onPress: focusSearch },
|
|
117
152
|
],
|
|
118
|
-
|
|
119
|
-
}), [load, query, state.error, state.loading]);
|
|
153
|
+
}), [focusSearch, state.error, state.loading]);
|
|
120
154
|
|
|
121
155
|
return (
|
|
122
156
|
<DataTableView<InstrumentSearchResult, DataTableColumn & { id: "symbol" | "name" | "exchange" | "type" }>
|
|
123
|
-
focused={focused}
|
|
157
|
+
focused={focused && !searchFocused}
|
|
158
|
+
rootBefore={(
|
|
159
|
+
<InputSearchBar
|
|
160
|
+
value={query}
|
|
161
|
+
focused={focused}
|
|
162
|
+
active={searchFocused}
|
|
163
|
+
width={width}
|
|
164
|
+
focusToken={searchFocusToken}
|
|
165
|
+
inputRef={searchInputRef}
|
|
166
|
+
placeholder="symbol or company name"
|
|
167
|
+
debounceMs={SEARCH_DEBOUNCE_MS}
|
|
168
|
+
normalizeValue={(value) => value.trim()}
|
|
169
|
+
onFocus={focusSearch}
|
|
170
|
+
onBlur={blurSearch}
|
|
171
|
+
onNavigateDown={blurSearch}
|
|
172
|
+
onQueryChange={updateQuery}
|
|
173
|
+
/>
|
|
174
|
+
)}
|
|
124
175
|
selection={{
|
|
125
176
|
kind: "index",
|
|
126
177
|
selectedIndex: boundedSelectedIdx,
|
|
@@ -137,7 +188,12 @@ export function ProviderSearchPane({ focused, width, height }: PaneProps) {
|
|
|
137
188
|
onHeaderClick={() => {}}
|
|
138
189
|
getItemKey={(row, index) => `${row.providerId}:${row.symbol}:${row.exchange}:${row.type}:${index}`}
|
|
139
190
|
renderCell={renderCell}
|
|
140
|
-
emptyStateTitle={state.
|
|
191
|
+
emptyStateTitle={state.error
|
|
192
|
+
? unavailableText("Provider search")
|
|
193
|
+
: state.loading
|
|
194
|
+
? loadingText("search results")
|
|
195
|
+
: query ? "No search results" : "No search query"}
|
|
196
|
+
emptyStateHint={state.error ?? (query ? undefined : "Press / to search.")}
|
|
141
197
|
/>
|
|
142
198
|
);
|
|
143
199
|
}
|
|
@@ -5,6 +5,7 @@ import { useCallback, useEffect, useMemo, useRef, useState, type SetStateAction
|
|
|
5
5
|
import { usePaneStateValue, usePaneTicker } from "../../../../state/app/context";
|
|
6
6
|
import {
|
|
7
7
|
DataTableView,
|
|
8
|
+
PaneStatusBody,
|
|
8
9
|
Tabs,
|
|
9
10
|
usePaneFooter,
|
|
10
11
|
type DataTableCell,
|
|
@@ -94,7 +95,6 @@ export function ResolvedFinancialsTab({
|
|
|
94
95
|
const [selectedRowId, setSelectedRowId] = useState<string | null>(null);
|
|
95
96
|
const bodyScrollRef = useRef<ScrollBoxRenderable>(null);
|
|
96
97
|
const headerScrollRef = useRef<ScrollBoxRenderable>(null);
|
|
97
|
-
const resolvedPeriodForFooter = resolveFinancialPeriod(period, hasAnnualStatements, hasQuarterlyStatements);
|
|
98
98
|
const { nativePaneChrome } = useUiCapabilities();
|
|
99
99
|
const subTab = FINANCIAL_SUB_TABS[subTabIdx]!;
|
|
100
100
|
const currentGroupIds = useMemo(() => collectGroupIds(subTab.rows), [subTab]);
|
|
@@ -147,11 +147,10 @@ export function ResolvedFinancialsTab({
|
|
|
147
147
|
});
|
|
148
148
|
}, [currentGroupIds]);
|
|
149
149
|
|
|
150
|
+
// The active section and period are already the visible tab selections, so the
|
|
151
|
+
// footer only carries what the controls cannot show.
|
|
150
152
|
usePaneFooter("financials", () => ({
|
|
151
|
-
info:
|
|
152
|
-
{ id: "section", parts: [{ text: FINANCIAL_SUB_TABS[subTabIdx]?.name ?? "Financials", tone: "value", bold: true }] },
|
|
153
|
-
{ id: "period", parts: [{ text: resolvedPeriodForFooter === "annual" ? "Annual" : "Quarterly", tone: "muted" }] },
|
|
154
|
-
] : [],
|
|
153
|
+
info: [],
|
|
155
154
|
hints: [
|
|
156
155
|
{
|
|
157
156
|
id: "section",
|
|
@@ -190,8 +189,7 @@ export function ResolvedFinancialsTab({
|
|
|
190
189
|
hasCollapsedCurrentGroup,
|
|
191
190
|
hasExpandedCurrentGroup,
|
|
192
191
|
hasQuarterlyStatements,
|
|
193
|
-
|
|
194
|
-
subTabIdx,
|
|
192
|
+
setSubTabIdx,
|
|
195
193
|
togglePeriod,
|
|
196
194
|
]);
|
|
197
195
|
|
|
@@ -283,8 +281,17 @@ export function ResolvedFinancialsTab({
|
|
|
283
281
|
setSelectedRowId(rows[0]!.id);
|
|
284
282
|
}, [rows, selectedRowId]);
|
|
285
283
|
|
|
284
|
+
// A null snapshot is still in flight; only a loaded one can say "no coverage".
|
|
286
285
|
if (!financials || (!hasAnnualStatements && !hasQuarterlyStatements)) {
|
|
287
|
-
return
|
|
286
|
+
return (
|
|
287
|
+
<PaneStatusBody
|
|
288
|
+
loading={!financials}
|
|
289
|
+
empty={!!financials}
|
|
290
|
+
subject="financials"
|
|
291
|
+
emptyTitle="No financial statements."
|
|
292
|
+
emptyMessage="This ticker has no annual or quarterly statement coverage."
|
|
293
|
+
/>
|
|
294
|
+
);
|
|
288
295
|
}
|
|
289
296
|
|
|
290
297
|
const renderCell = (
|