gloomberb 0.6.1 → 0.7.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.
Files changed (139) hide show
  1. package/package.json +1 -1
  2. package/patches/@opentui%2Fcore@0.1.90.patch +48 -24
  3. package/src/app.tsx +9 -6
  4. package/src/cli/registry.test.ts +0 -1
  5. package/src/components/chart/chart-controller.ts +0 -1
  6. package/src/components/chart/chart-data.ts +1 -31
  7. package/src/components/chart/chart-renderer.ts +70 -0
  8. package/src/components/chart/chart-resolution.test.ts +0 -36
  9. package/src/components/chart/chart-resolution.ts +0 -27
  10. package/src/components/chart/chart.test.ts +17 -45
  11. package/src/components/chart/comparison-chart-data.test.ts +1 -5
  12. package/src/components/chart/comparison-chart-data.ts +1 -4
  13. package/src/components/chart/comparison-stock-chart.tsx +48 -27
  14. package/src/components/chart/static-chart-surface.tsx +28 -4
  15. package/src/components/chart/stock-chart.test.ts +0 -16
  16. package/src/components/chart/stock-chart.tsx +38 -21
  17. package/src/components/chart/time-axis-label.tsx +43 -0
  18. package/src/components/command-bar/command-bar.test.tsx +71 -8
  19. package/src/components/command-bar/command-bar.tsx +388 -713
  20. package/src/components/command-bar/confirm-body.tsx +51 -0
  21. package/src/components/command-bar/list-model.ts +77 -0
  22. package/src/components/command-bar/view-model.ts +0 -19
  23. package/src/components/command-bar/workflow-ops.ts +4 -0
  24. package/src/components/data-table-stack-view.test.tsx +39 -4
  25. package/src/components/data-table-stack-view.tsx +11 -104
  26. package/src/components/data-table-view.tsx +43 -79
  27. package/src/components/feed-data-table-stack-view.tsx +10 -17
  28. package/src/components/feed-stack-controller.ts +39 -0
  29. package/src/components/index.ts +5 -1
  30. package/src/components/layout/floating-pane.tsx +30 -2
  31. package/src/components/layout/header.tsx +10 -7
  32. package/src/components/layout/pane-cycle-order.test.ts +30 -0
  33. package/src/components/layout/pane-cycle-order.ts +32 -0
  34. package/src/components/layout/pane-footer.tsx +11 -4
  35. package/src/components/layout/pane-header.tsx +5 -5
  36. package/src/components/layout/shell.test.tsx +66 -22
  37. package/src/components/layout/shell.tsx +13 -6
  38. package/src/components/onboarding/onboarding-wizard.tsx +1 -2
  39. package/src/components/pane-settings-dialog.tsx +12 -4
  40. package/src/components/pane-template-wizard.test.tsx +3 -4
  41. package/src/components/speedometer-gauge.test.tsx +45 -0
  42. package/src/components/speedometer-gauge.tsx +558 -0
  43. package/src/components/table-view-shared.tsx +158 -0
  44. package/src/components/ticker-list-table-view.tsx +42 -72
  45. package/src/components/ui/confirm-dialog.tsx +66 -0
  46. package/src/components/ui/data-table.tsx +18 -10
  47. package/src/components/ui/index.ts +0 -1
  48. package/src/components/ui/page-stack-view.tsx +39 -10
  49. package/src/components/ui/table-layout.test.ts +16 -0
  50. package/src/components/ui/table-layout.ts +10 -3
  51. package/src/components/ui/ui.test.tsx +100 -20
  52. package/src/core/state/app-state.ts +6 -3
  53. package/src/market-data/coordinator.test.ts +1 -1
  54. package/src/market-data/coordinator.ts +0 -1
  55. package/src/news/aggregator.ts +0 -3
  56. package/src/plugins/builtin/ai/ask-ai-detail-tab.tsx +46 -16
  57. package/src/plugins/builtin/ai/providers.ts +0 -17
  58. package/src/plugins/builtin/ai/screener-pane.test.tsx +3 -4
  59. package/src/plugins/builtin/ai/screener-pane.tsx +0 -3
  60. package/src/plugins/builtin/ask-ai.test.tsx +89 -2
  61. package/src/plugins/builtin/broker-manager/index.test.tsx +2 -2
  62. package/src/plugins/builtin/broker-manager/index.tsx +19 -36
  63. package/src/plugins/builtin/chat-controller.test.ts +105 -0
  64. package/src/plugins/builtin/chat-controller.ts +75 -6
  65. package/src/plugins/builtin/chat.test.tsx +6 -6
  66. package/src/plugins/builtin/chat.tsx +29 -20
  67. package/src/plugins/builtin/cloud-tweets.tsx +0 -1
  68. package/src/plugins/builtin/comparison-chart.test.tsx +53 -2
  69. package/src/plugins/builtin/comparison-chart.tsx +11 -5
  70. package/src/plugins/builtin/correlation/index.tsx +1 -6
  71. package/src/plugins/builtin/debug.tsx +1 -3
  72. package/src/plugins/builtin/econ/index.tsx +1 -2
  73. package/src/plugins/builtin/fear-greed/fear-greed-data.test.ts +72 -0
  74. package/src/plugins/builtin/fear-greed/fear-greed-data.ts +366 -0
  75. package/src/plugins/builtin/fear-greed/index.tsx +478 -0
  76. package/src/plugins/builtin/fx-matrix/index.tsx +2 -2
  77. package/src/plugins/builtin/help.test.tsx +2 -2
  78. package/src/plugins/builtin/help.tsx +2 -2
  79. package/src/plugins/builtin/holders/index.tsx +10 -15
  80. package/src/plugins/builtin/insider/index.tsx +22 -89
  81. package/src/plugins/builtin/market-movers/index.tsx +1 -1
  82. package/src/plugins/builtin/news-wire/index.tsx +41 -2
  83. package/src/plugins/builtin/news-wire/news-table.tsx +11 -11
  84. package/src/plugins/builtin/news.tsx +4 -16
  85. package/src/plugins/builtin/notes.tsx +18 -55
  86. package/src/plugins/builtin/options.test.tsx +58 -2
  87. package/src/plugins/builtin/options.tsx +108 -49
  88. package/src/plugins/builtin/plugin-groups.ts +2 -0
  89. package/src/plugins/builtin/portfolio-list/cli/commands.ts +1 -1
  90. package/src/plugins/builtin/research/index.tsx +5 -21
  91. package/src/plugins/builtin/sec-filing-display.tsx +84 -0
  92. package/src/plugins/builtin/sec.tsx +13 -66
  93. package/src/plugins/builtin/sectors/index.tsx +1 -1
  94. package/src/plugins/builtin/ticker-detail/chart-tab.tsx +0 -1
  95. package/src/plugins/builtin/ticker-detail/index.tsx +0 -1
  96. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +0 -1
  97. package/src/plugins/builtin/ticker-detail-chart-tab-switch.test.tsx +3 -4
  98. package/src/plugins/builtin/world-indices/index.tsx +1 -1
  99. package/src/plugins/builtin/yield-curve/index.tsx +1 -1
  100. package/src/plugins/ibkr/broker-adapter.ts +1 -3
  101. package/src/plugins/ibkr/gateway-service-native.ts +1 -5
  102. package/src/plugins/ibkr/gateway-service.ts +1 -1
  103. package/src/plugins/ibkr/index.test.tsx +0 -2
  104. package/src/plugins/ibkr/trade-tab.test.tsx +3 -4
  105. package/src/plugins/pane-manager.ts +0 -13
  106. package/src/plugins/plugin-runtime.test.tsx +6 -6
  107. package/src/plugins/plugin-runtime.tsx +13 -8
  108. package/src/plugins/prediction-markets/cli.ts +0 -1
  109. package/src/plugins/prediction-markets/controller-data.ts +0 -2
  110. package/src/plugins/prediction-markets/pane.test.tsx +3 -11
  111. package/src/plugins/prediction-markets/test-helpers.tsx +1 -1
  112. package/src/plugins/registry.ts +10 -39
  113. package/src/react/input.ts +1 -0
  114. package/src/renderers/electrobun/view/data-table.tsx +28 -6
  115. package/src/renderers/electrobun/view/desktop-controls.tsx +34 -20
  116. package/src/renderers/electrobun/view/dialog-host.tsx +11 -1
  117. package/src/renderers/electrobun/view/input-host.tsx +74 -10
  118. package/src/renderers/electrobun/view/key-event.ts +1 -1
  119. package/src/renderers/electrobun/view/styles.css +331 -0
  120. package/src/renderers/opentui/chart-surface.tsx +179 -0
  121. package/src/renderers/opentui/start.tsx +48 -30
  122. package/src/renderers/opentui/test-utils.tsx +17 -0
  123. package/src/renderers/opentui/ui-host.tsx +5 -2
  124. package/src/sources/provider-router.ts +0 -4
  125. package/src/state/app-context.test.ts +45 -0
  126. package/src/state/use-inline-tickers.test.tsx +73 -0
  127. package/src/state/use-inline-tickers.ts +7 -1
  128. package/src/test-support/plugin-runtime.ts +3 -2
  129. package/src/theme/colors.ts +12 -3
  130. package/src/theme/themes.test.ts +23 -1
  131. package/src/theme/themes.ts +115 -0
  132. package/src/types/broker.ts +1 -1
  133. package/src/types/data-provider.ts +0 -1
  134. package/src/types/plugin.ts +0 -2
  135. package/src/ui/host.tsx +1 -0
  136. package/src/utils/back-navigation.ts +24 -1
  137. package/src/version.ts +1 -1
  138. package/src/plugins/builtin/news-wire/feed-pane.tsx +0 -21
  139. package/src/plugins/builtin/news-wire/top-pane.tsx +0 -21
@@ -1,7 +1,6 @@
1
1
  import { afterEach, describe, expect, test } from "bun:test";
2
2
  import { act, useReducer } from "react";
3
- import { testRender } from "../../renderers/opentui/test-utils";
4
- import { DialogProvider } from "@opentui-ui/dialog/react";
3
+ import { TestDialogProvider, testRender } from "../../renderers/opentui/test-utils";
5
4
  import { CommandBar } from "./command-bar";
6
5
  import { AppContext, type AppState, appReducer, createInitialState, getEffectiveThemeId } from "../../state/app-context";
7
6
  import { createTestDataProvider } from "../../test-support/data-provider";
@@ -213,9 +212,9 @@ function makePluginRegistry(hasPaneSettings: (paneId: string) => boolean = () =>
213
212
  getPluginPaneTemplateIds: () => [],
214
213
  hasPaneSettings,
215
214
  events: { emit: () => {} },
216
- hideWidget: () => {},
215
+ hidePane: () => {},
217
216
  pinTicker: () => {},
218
- showWidget: () => {},
217
+ showPane: () => {},
219
218
  updateLayoutFn: () => {},
220
219
  getTermSizeFn: () => ({ width: 80, height: 24 }),
221
220
  notify: () => {},
@@ -304,7 +303,7 @@ function CommandBarHarness({
304
303
 
305
304
  return (
306
305
  <AppContext value={{ state: currentState, dispatch: currentDispatch }}>
307
- <DialogProvider dialogOptions={{ style: { backgroundColor: "#000000", borderColor: "#ffffff", borderStyle: "single" } }}>
306
+ <TestDialogProvider>
308
307
  {live && <text>{`theme:${getEffectiveThemeId(currentState)}`}</text>}
309
308
  {showQueryState && <text>{`query:${currentState.commandBarQuery}`}</text>}
310
309
  {currentState.commandBarOpen && (
@@ -316,7 +315,7 @@ function CommandBarHarness({
316
315
  onCheckForUpdates={onCheckForUpdates}
317
316
  />
318
317
  )}
319
- </DialogProvider>
318
+ </TestDialogProvider>
320
319
  </AppContext>
321
320
  );
322
321
  }
@@ -740,7 +739,12 @@ describe("CommandBar", () => {
740
739
  expect(frame).toContain("Commands");
741
740
  expect(frame).toContain("TH");
742
741
  expect(frame).toContain("Themes");
743
- expect(frame).toMatchSnapshot();
742
+ expect(frame).toContain("Amber");
743
+ expect(frame).toContain("Paper");
744
+ expect(frame).toContain("GitHub Light");
745
+ expect(frame).toContain("Solarized Light");
746
+ expect(frame).toContain("Gruvbox Light");
747
+ expect(frame).toContain("Nord Light");
744
748
  });
745
749
 
746
750
  test("renders plugin toggle state", async () => {
@@ -2197,6 +2201,50 @@ describe("CommandBar", () => {
2197
2201
  expect(frame).toContain("AAPL,");
2198
2202
  });
2199
2203
 
2204
+ test("CMP with one resolved ticker opens inline completion instead of creating a one-symbol chart", async () => {
2205
+ const created: Array<{ templateId: string; options?: Record<string, unknown> }> = [];
2206
+
2207
+ testSetup = await testRender(<CommandBarHarness
2208
+ query="CMP AMD"
2209
+ extraTickers={[makeTicker("AMD", "Advanced Micro Devices")]}
2210
+ configurePluginRegistry={(pluginRegistry) => {
2211
+ (pluginRegistry.panes as Map<string, any>).set("comparison-chart", {
2212
+ id: "comparison-chart",
2213
+ name: "Comparison Chart",
2214
+ component: () => null,
2215
+ defaultPosition: "right",
2216
+ });
2217
+ (pluginRegistry.paneTemplates as Map<string, any>).set("comparison-chart-pane", {
2218
+ id: "comparison-chart-pane",
2219
+ paneId: "comparison-chart",
2220
+ label: "Comparison Chart",
2221
+ description: "Compare multiple symbols in one pane",
2222
+ shortcut: { prefix: "CMP", argPlaceholder: "tickers", argKind: "ticker-list" },
2223
+ wizard: [{ key: "tickers", label: "Tickers", type: "text" }],
2224
+ canCreate: (_context: unknown, options?: { symbols?: string[] | null }) => !options?.symbols || options.symbols.length >= 2,
2225
+ });
2226
+ pluginRegistry.createPaneFromTemplateAsyncFn = async (templateId, options) => {
2227
+ created.push({ templateId, options });
2228
+ };
2229
+ }}
2230
+ />, {
2231
+ width: 100,
2232
+ height: 20,
2233
+ });
2234
+
2235
+ await testSetup.renderOnce();
2236
+ await act(async () => {
2237
+ testSetup!.mockInput.pressEnter();
2238
+ await Bun.sleep(0);
2239
+ await testSetup!.renderOnce();
2240
+ });
2241
+
2242
+ const frame = await waitForFrameToContain("Tickers");
2243
+ expect(created).toEqual([]);
2244
+ expect(frame).toContain("Comparison Chart");
2245
+ expect(frame).toContain("AMD");
2246
+ });
2247
+
2200
2248
  test("AI <prompt> opens the inline workflow and prefills the textarea prompt", async () => {
2201
2249
  const created: Array<{ templateId: string; options?: Record<string, unknown> }> = [];
2202
2250
 
@@ -2608,7 +2656,15 @@ describe("CommandBar", () => {
2608
2656
  });
2609
2657
 
2610
2658
  test("matches the direct help command", async () => {
2611
- testSetup = await testRender(<CommandBarHarness query="help" />, {
2659
+ const openedPanes: string[] = [];
2660
+ testSetup = await testRender(<CommandBarHarness
2661
+ query="help"
2662
+ configurePluginRegistry={(pluginRegistry) => {
2663
+ pluginRegistry.showPane = (paneId: string) => {
2664
+ openedPanes.push(paneId);
2665
+ };
2666
+ }}
2667
+ />, {
2612
2668
  width: 80,
2613
2669
  height: 18,
2614
2670
  });
@@ -2618,6 +2674,13 @@ describe("CommandBar", () => {
2618
2674
  const frame = testSetup.captureCharFrame();
2619
2675
  expect(frame).toContain("Help");
2620
2676
  expect(frame).toContain("Navigation");
2677
+
2678
+ await act(async () => {
2679
+ testSetup!.mockInput.pressEnter();
2680
+ await testSetup!.renderOnce();
2681
+ });
2682
+
2683
+ expect(openedPanes).toEqual(["help"]);
2621
2684
  });
2622
2685
 
2623
2686
  test("skips pane templates whose canCreate throws", async () => {