gloomberb 0.19.3 → 0.19.5

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 (226) hide show
  1. package/package.json +4 -2
  2. package/src/api-client/errors.ts +8 -0
  3. package/src/api-client/index.ts +18 -0
  4. package/src/api-client/request.ts +295 -42
  5. package/src/api-client/socket.ts +95 -0
  6. package/src/app/keybindings/actions.ts +1 -1
  7. package/src/app/pane-runtime/index.tsx +1 -1
  8. package/src/app/pane-runtime/ticker-inspector-runtime.ts +1 -1
  9. package/src/app/pane-runtime/ticker-open-runtime.ts +1 -1
  10. package/src/app/pane-runtime/ticker-open-target.ts +12 -2
  11. package/src/cli/commands/command-utils.ts +4 -0
  12. package/src/cli/commands/market.ts +119 -27
  13. package/src/cli/commands/search.ts +1 -1
  14. package/src/cli/commands/ticker.ts +10 -6
  15. package/src/cli/currency-name-hint.ts +60 -0
  16. package/src/cli/desktop-pane-shot-api-policy.ts +10 -2
  17. package/src/cli/desktop-pane-shot.ts +2 -1
  18. package/src/cli/history-rows.ts +18 -1
  19. package/src/cli/known-gaps.ts +17 -2
  20. package/src/cli/not-a-ticker.ts +5 -3
  21. package/src/cli/pane-functions/catalog.ts +9 -1
  22. package/src/cli/pane-functions/headless.ts +7 -3
  23. package/src/cli/pane-functions/market-session.ts +6 -7
  24. package/src/cli/series-search.ts +4 -5
  25. package/src/components/chart/composite/panel-bitmap.ts +28 -2
  26. package/src/components/chart/composite/time-axis.ts +17 -2
  27. package/src/components/command-bar/action-runtime.ts +2 -0
  28. package/src/components/command-bar/commands/direct/runtime.ts +3 -3
  29. package/src/components/command-bar/helpers.ts +2 -0
  30. package/src/components/command-bar/list/model.ts +9 -0
  31. package/src/components/command-bar/pane-actions.ts +46 -35
  32. package/src/components/command-bar/pane-templates/workflow.ts +6 -0
  33. package/src/components/command-bar/panel/index.tsx +30 -3
  34. package/src/components/command-bar/panel/types.ts +7 -0
  35. package/src/components/command-bar/routes/root/results.ts +4 -4
  36. package/src/components/command-bar/routes/root/selection.ts +3 -2
  37. package/src/components/command-bar/routes/ticker-search/actions.ts +21 -16
  38. package/src/components/command-bar/routing/launch-request.ts +3 -2
  39. package/src/components/command-bar/routing/list-state.ts +4 -1
  40. package/src/components/command-bar/surface/index.tsx +15 -1
  41. package/src/components/layout/floating-pane.tsx +10 -0
  42. package/src/components/layout/pane/frame.tsx +6 -0
  43. package/src/components/layout/pane/header.tsx +244 -42
  44. package/src/components/layout/pane/index.tsx +20 -2
  45. package/src/components/layout/shell/active-drag.ts +160 -28
  46. package/src/components/layout/shell/drag/index.ts +99 -96
  47. package/src/components/layout/shell/drag/live.ts +3 -17
  48. package/src/components/layout/shell/drag/magnets.ts +304 -0
  49. package/src/components/layout/shell/drag/overlays.tsx +77 -75
  50. package/src/components/layout/shell/drag/runtime.ts +12 -7
  51. package/src/components/layout/shell/index.tsx +66 -32
  52. package/src/components/layout/shell/native/pointer-runtime.ts +7 -2
  53. package/src/components/layout/shell/native/surfaces.ts +1 -9
  54. package/src/components/layout/shell/native/window-state.ts +21 -25
  55. package/src/components/layout/shell/pane/layers.tsx +153 -24
  56. package/src/components/layout/shell/shortcuts.ts +4 -1
  57. package/src/components/layout/shell/terminal-pointer-runtime.ts +24 -1
  58. package/src/components/layout/shell/window-mode/overlays.tsx +14 -6
  59. package/src/components/layout/status-bar.tsx +75 -6
  60. package/src/components/layout/window-controls.tsx +96 -35
  61. package/src/components/layout/window-fullscreen.ts +20 -0
  62. package/src/components/quote-flash.ts +36 -32
  63. package/src/core/app-runtime.ts +4 -1
  64. package/src/core/connection-health.ts +76 -1
  65. package/src/core/state/app/command-bar-launch.ts +12 -0
  66. package/src/core/state/app/layout.ts +4 -3
  67. package/src/core/state/app/types.ts +4 -1
  68. package/src/data/config/layout.ts +2 -2
  69. package/src/data/config/store/fold-panes.ts +6 -1
  70. package/src/i18n/es.ts +8 -1
  71. package/src/i18n/ja.ts +8 -1
  72. package/src/i18n/ko.ts +8 -1
  73. package/src/i18n/zh-cn.ts +8 -1
  74. package/src/i18n/zh-tw.ts +8 -1
  75. package/src/layout/pane-follow.ts +3 -2
  76. package/src/layout/pane-layout-move.ts +2 -1
  77. package/src/layout/pane-manager/dock-stack.ts +38 -0
  78. package/src/layout/pane-manager/dock-tree.ts +76 -15
  79. package/src/layout/pane-manager/docking.ts +48 -6
  80. package/src/layout/pane-manager/floating-actions.ts +12 -3
  81. package/src/layout/pane-manager/floating-placement.ts +189 -0
  82. package/src/layout/pane-manager/floating.ts +23 -4
  83. package/src/layout/pane-manager/gridlock.ts +16 -4
  84. package/src/layout/pane-manager/hidden-panes.ts +30 -1
  85. package/src/layout/pane-manager/index.ts +2 -0
  86. package/src/layout/pane-manager/layout-state.ts +17 -0
  87. package/src/layout/pane-manager/types.ts +4 -1
  88. package/src/layout/ticker-retarget.ts +88 -0
  89. package/src/layout-marketplace/cloud.ts +9 -1
  90. package/src/market-data/connection-follow.ts +68 -0
  91. package/src/market-data/coordinator/entries.ts +15 -3
  92. package/src/market-data/coordinator/events.ts +17 -1
  93. package/src/market-data/coordinator/financials.ts +20 -7
  94. package/src/market-data/coordinator/index.ts +217 -4
  95. package/src/market-data/coordinator/quotes.ts +10 -0
  96. package/src/market-data/frame-scheduler.ts +47 -10
  97. package/src/market-data/frame-wake.ts +74 -0
  98. package/src/market-data/futures-board.ts +7 -6
  99. package/src/market-data/hooks.tsx +43 -3
  100. package/src/market-data/performance.ts +78 -9
  101. package/src/market-data/request-types.ts +6 -3
  102. package/src/news/aggregator.ts +12 -1
  103. package/src/plugins/builtin/alerts/cli.ts +2 -1
  104. package/src/plugins/builtin/analytics/risk-evidence.ts +1 -0
  105. package/src/plugins/builtin/attention/evidence.ts +1 -1
  106. package/src/plugins/builtin/awards/client.ts +1 -1
  107. package/src/plugins/builtin/awards/evidence.ts +1 -1
  108. package/src/plugins/builtin/awards/pane.tsx +2 -1
  109. package/src/plugins/builtin/bond-calculator/math.ts +1 -1
  110. package/src/plugins/builtin/broker-manager/footer.ts +3 -2
  111. package/src/plugins/builtin/broker-manager/index.tsx +2 -1
  112. package/src/plugins/builtin/broker-manager/keyboard.ts +2 -1
  113. package/src/plugins/builtin/buildout/company/pane.tsx +2 -1
  114. package/src/plugins/builtin/buildout/model/index.ts +6 -0
  115. package/src/plugins/builtin/buildout/pane/index.tsx +2 -1
  116. package/src/plugins/builtin/catalysts/evidence.ts +1 -1
  117. package/src/plugins/builtin/catalysts/pane.tsx +2 -1
  118. package/src/plugins/builtin/chart-composer/headless.ts +40 -1
  119. package/src/plugins/builtin/chart-composer/index.tsx +13 -0
  120. package/src/plugins/builtin/chat/controller/index.ts +10 -3
  121. package/src/plugins/builtin/chat/controller/session-runtime.ts +9 -2
  122. package/src/plugins/builtin/chat/status-widget.tsx +3 -1
  123. package/src/plugins/builtin/cloud-tweets/table.tsx +3 -2
  124. package/src/plugins/builtin/comment-letters/client.ts +2 -1
  125. package/src/plugins/builtin/company-kpis/client.ts +1 -1
  126. package/src/plugins/builtin/company-kpis/pane.tsx +2 -1
  127. package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +3 -2
  128. package/src/plugins/builtin/cot/headless.ts +9 -3
  129. package/src/plugins/builtin/cot/model.ts +44 -3
  130. package/src/plugins/builtin/credit-documents/client.ts +1 -1
  131. package/src/plugins/builtin/credit-documents/evidence.ts +1 -1
  132. package/src/plugins/builtin/credit-documents/pane.tsx +2 -1
  133. package/src/plugins/builtin/earnings-calls/pane.tsx +1 -1
  134. package/src/plugins/builtin/earnings-ripple/index.tsx +6 -1
  135. package/src/plugins/builtin/econ/calendar-model.ts +2 -0
  136. package/src/plugins/builtin/econ/fred-catalog.ts +5 -5
  137. package/src/plugins/builtin/econ/print-watch.ts +3 -1
  138. package/src/plugins/builtin/futures/series.ts +16 -1
  139. package/src/plugins/builtin/fx-matrix/headless.ts +4 -2
  140. package/src/plugins/builtin/fx-matrix/index.tsx +37 -3
  141. package/src/plugins/builtin/fx-matrix/pairs.ts +15 -0
  142. package/src/plugins/builtin/gpu/headless.ts +2 -1
  143. package/src/plugins/builtin/help/function-card.tsx +2 -1
  144. package/src/plugins/builtin/help/index.tsx +3 -2
  145. package/src/plugins/builtin/insider/display.ts +45 -6
  146. package/src/plugins/builtin/ipo-calendar/model.ts +2 -0
  147. package/src/plugins/builtin/iv-history/client.ts +2 -1
  148. package/src/plugins/builtin/iv-history/headless.ts +2 -1
  149. package/src/plugins/builtin/jobs/pages.ts +4 -4
  150. package/src/plugins/builtin/kelly-sizer/headless.ts +2 -1
  151. package/src/plugins/builtin/market-heatmap/index.tsx +2 -1
  152. package/src/plugins/builtin/members/client.ts +1 -1
  153. package/src/plugins/builtin/mna/distress/client.ts +1 -0
  154. package/src/plugins/builtin/mna/pane.tsx +4 -1
  155. package/src/plugins/builtin/options/market-reference.ts +1 -1
  156. package/src/plugins/builtin/options/open-interest-as-of.ts +3 -1
  157. package/src/plugins/builtin/options/view.tsx +2 -1
  158. package/src/plugins/builtin/options-calculator/evidence.ts +1 -1
  159. package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
  160. package/src/plugins/builtin/options-scenario/csp-screen.ts +8 -4
  161. package/src/plugins/builtin/options-scenario/csp.ts +28 -9
  162. package/src/plugins/builtin/options-scenario/evidence.ts +5 -4
  163. package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
  164. package/src/plugins/builtin/perps/client.ts +1 -1
  165. package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +2 -1
  166. package/src/plugins/builtin/portfolio-list/pane/index.tsx +7 -3
  167. package/src/plugins/builtin/portfolio-list/use-throttled-memo.ts +10 -19
  168. package/src/plugins/builtin/research/analyst-model.ts +1 -0
  169. package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +2 -1
  170. package/src/plugins/builtin/research/index.tsx +1 -0
  171. package/src/plugins/builtin/research/relative-valuation-currency.ts +1 -1
  172. package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -1
  173. package/src/plugins/builtin/research-search/command-bar-search.ts +3 -1
  174. package/src/plugins/builtin/research-search/snippet.ts +1 -0
  175. package/src/plugins/builtin/revenue-breakdown/client.ts +3 -2
  176. package/src/plugins/builtin/seasonality/headless.ts +2 -1
  177. package/src/plugins/builtin/sec/command-bar-search.ts +3 -2
  178. package/src/plugins/builtin/sec/index.tsx +7 -4
  179. package/src/plugins/builtin/sec/row-summaries.ts +28 -12
  180. package/src/plugins/builtin/sectors/client.ts +18 -8
  181. package/src/plugins/builtin/sectors/index.tsx +19 -5
  182. package/src/plugins/builtin/short-interest/watch-client.ts +2 -1
  183. package/src/plugins/builtin/social-mentions/client.ts +2 -1
  184. package/src/plugins/builtin/supply-chain/client.ts +1 -1
  185. package/src/plugins/builtin/supply-chain/evidence.ts +1 -1
  186. package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -1
  187. package/src/plugins/builtin/supply-chain/pane.tsx +2 -1
  188. package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +1 -1
  189. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +24 -4
  190. package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +1 -1
  191. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +4 -1
  192. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +25 -2
  193. package/src/plugins/builtin/time-sales/client.ts +1 -0
  194. package/src/plugins/builtin/vol-surface/client.ts +2 -1
  195. package/src/plugins/builtin/yield-curve/headless.ts +3 -1
  196. package/src/portfolio/column-values.ts +76 -10
  197. package/src/react/async-resource.ts +12 -0
  198. package/src/remote/controller.ts +3 -1
  199. package/src/renderers/browser/app-services.ts +8 -1
  200. package/src/renderers/browser/cloud-transport.ts +6 -1
  201. package/src/renderers/cloudflare/worker.ts +24 -2
  202. package/src/renderers/dom/host/box.tsx +204 -176
  203. package/src/renderers/dom/host/style.ts +49 -20
  204. package/src/renderers/dom/host/text.tsx +3 -2
  205. package/src/renderers/dom/styles.css +32 -0
  206. package/src/renderers/electrobun/bun/desktop/backend.ts +2 -0
  207. package/src/renderers/electrobun/bun/desktop/host-requests.ts +25 -1
  208. package/src/renderers/electrobun/bun/desktop/relaunch.ts +9 -1
  209. package/src/renderers/electrobun/bun/desktop/windows-script.ts +9 -6
  210. package/src/renderers/electrobun/bun/window/windows-native.ts +26 -1
  211. package/src/renderers/electrobun/shared/protocol.ts +6 -0
  212. package/src/renderers/electrobun/view/ui-host.tsx +7 -0
  213. package/src/renderers/electrobun/view/window-fullscreen.ts +10 -3
  214. package/src/shares/portable-layout.ts +99 -2
  215. package/src/sources/provider-router/index.ts +9 -3
  216. package/src/sources/provider-router/sources.ts +26 -1
  217. package/src/sync/core-contributors.ts +18 -4
  218. package/src/time-series/price-units.ts +11 -0
  219. package/src/time-series/resolve.ts +12 -0
  220. package/src/types/config.ts +17 -1
  221. package/src/types/plugin.ts +6 -0
  222. package/src/ui/host.tsx +2 -0
  223. package/src/utils/currency-names.ts +20 -0
  224. package/src/utils/currency-pair.ts +6 -0
  225. package/src/utils/exchange-rate-snapshot.ts +20 -2
  226. package/src/utils/fx-market-hours.ts +43 -0
@@ -6,16 +6,17 @@ import {
6
6
  resolveFollowBindingInstance,
7
7
  TICKER_RESEARCH_PANE_ID,
8
8
  type LayoutConfig,
9
+ type PaneInstanceConfig,
9
10
  } from "../../types/config";
10
11
  import {
11
12
  addPaneFloating,
12
13
  addPaneToLayout,
13
14
  } from "../../layout/pane-manager";
15
+ import { resolveTickerRetargetPane, retargetTickerPane } from "../../layout/ticker-retarget";
14
16
  import type { PluginRegistry } from "../../plugins/registry";
15
17
  import type { PinTickerOptions } from "../../types/plugin";
16
- import { tickerInstrumentLabel } from "../../tickers/instrument-label";
17
18
  import { instrumentFromTicker } from "../../market-data/request-types";
18
- import type { AppAction, AppState } from "../../state/app/context";
19
+ import { resolveTickerForPane, type AppAction, type AppState } from "../../state/app/context";
19
20
  import { recordFunctionOpen } from "../../telemetry/usage-counts";
20
21
 
21
22
  /** Points the portfolio pane the focus follows (or the main one) at a collection. */
@@ -46,24 +47,6 @@ export function useCommandBarPaneActions({
46
47
  pluginRegistry,
47
48
  stateRef,
48
49
  }: CommandBarPaneActionsOptions) {
49
- const retargetTickerResearchPane = useCallback((paneId: string, symbol: string, options?: PinTickerOptions) => {
50
- const currentState = stateRef.current;
51
- const targetPane = findPaneInstance(currentState.config.layout, paneId);
52
- if (!targetPane || targetPane.paneId !== TICKER_RESEARCH_PANE_ID) return;
53
- const instrument = options?.instrument !== undefined ? options.instrument : instrumentFromTicker(currentState.tickers.get(symbol))?.instrument ?? undefined;
54
-
55
- const nextLayout = {
56
- ...currentState.config.layout,
57
- instances: currentState.config.layout.instances.map((instance) => (
58
- instance.instanceId === targetPane.instanceId
59
- ? { ...instance, title: tickerInstrumentLabel(symbol, instrument), binding: { kind: "fixed" as const, symbol, ...(instrument !== undefined ? { instrument } : {}), ...(options?.listing ? { listing: options.listing } : {}) } }
60
- : instance
61
- )),
62
- };
63
- dispatch({ type: "UPDATE_LAYOUT", layout: nextLayout });
64
- dispatch({ type: "FOCUS_PANE", paneId: targetPane.instanceId });
65
- }, [dispatch, stateRef]);
66
-
67
50
  const openFixedTickerPane = useCallback((symbol: string, options?: PinTickerOptions) => {
68
51
  pluginRegistry.pinTicker(symbol, {
69
52
  floating: true,
@@ -74,29 +57,56 @@ export function useCommandBarPaneActions({
74
57
  });
75
58
  }, [pluginRegistry]);
76
59
 
60
+ const persistLayoutChange = useCallback((nextLayout: LayoutConfig) => {
61
+ pluginRegistry.updateLayout(nextLayout);
62
+ }, [pluginRegistry]);
63
+
64
+ /** Pins `target` on the ticker; the focus stays on the pane it was on. */
65
+ const retargetPane = useCallback((target: PaneInstanceConfig, symbol: string, options?: PinTickerOptions) => {
66
+ const currentState = stateRef.current;
67
+ // Opening a research pane is counted in pinTicker; retargeting one here is DES too.
68
+ if (target.paneId === TICKER_RESEARCH_PANE_ID) recordFunctionOpen({ shortcut: "DES", externalPluginId: null });
69
+ const instrument = options?.instrument !== undefined
70
+ ? options.instrument
71
+ : instrumentFromTicker(currentState.tickers.get(symbol))?.instrument ?? undefined;
72
+ persistLayoutChange(retargetTickerPane(currentState.config.layout, target, symbol, {
73
+ instrument,
74
+ listing: options?.listing,
75
+ previous: resolveTickerForPane(currentState, target.instanceId),
76
+ paneDef: pluginRegistry.panes.get(target.paneId),
77
+ }));
78
+ dispatch({ type: "FOCUS_PANE", paneId: currentState.focusedPaneId ?? target.instanceId });
79
+ }, [dispatch, persistLayoutChange, pluginRegistry.panes, stateRef]);
80
+
81
+ /**
82
+ * DES and the command bar's ticker rows: a focused Ticker Research pane changes to the ticker,
83
+ * and from any other pane a research pane opens on it.
84
+ */
77
85
  const focusTicker = useCallback((symbol: string, options?: PinTickerOptions) => {
78
86
  const currentState = stateRef.current;
79
87
  const focusedPane = currentState.focusedPaneId
80
88
  ? findPaneInstance(currentState.config.layout, currentState.focusedPaneId)
81
89
  : null;
82
- if (options?.forceNewPane) {
83
- openFixedTickerPane(symbol, options);
90
+ if (!options?.forceNewPane && focusedPane?.paneId === TICKER_RESEARCH_PANE_ID) {
91
+ retargetPane(focusedPane, symbol, options);
84
92
  return;
85
93
  }
86
-
87
- if (focusedPane?.paneId === TICKER_RESEARCH_PANE_ID) {
88
- // Opening a research pane is counted in pinTicker; retargeting one here is DES too.
89
- recordFunctionOpen({ shortcut: "DES", externalPluginId: null });
90
- retargetTickerResearchPane(focusedPane.instanceId, symbol, options);
91
- return;
92
- }
93
-
94
94
  openFixedTickerPane(symbol, options);
95
- }, [openFixedTickerPane, retargetTickerResearchPane, stateRef]);
95
+ }, [openFixedTickerPane, retargetPane, stateRef]);
96
96
 
97
- const persistLayoutChange = useCallback((nextLayout: LayoutConfig) => {
98
- pluginRegistry.updateLayout(nextLayout);
99
- }, [pluginRegistry]);
97
+ /**
98
+ * Ticker search's Enter (the backtick, or the ticker in a pane's header): the focused pane
99
+ * changes to the ticker when it shows one, with the panes linked to it (the rule is
100
+ * `resolveTickerRetargetPane`). From any other pane it does what DES does.
101
+ */
102
+ const changePaneTicker = useCallback((symbol: string, options?: PinTickerOptions) => {
103
+ const currentState = stateRef.current;
104
+ const target = options?.forceNewPane
105
+ ? null
106
+ : resolveTickerRetargetPane(currentState.config.layout, currentState.focusedPaneId, pluginRegistry.panes);
107
+ if (target) retargetPane(target, symbol, options);
108
+ else focusTicker(symbol, options);
109
+ }, [focusTicker, pluginRegistry.panes, retargetPane, stateRef]);
100
110
 
101
111
  const duplicatePane = useCallback((paneId: string) => {
102
112
  const currentState = stateRef.current;
@@ -114,13 +124,14 @@ export function useCommandBarPaneActions({
114
124
 
115
125
  const { width, height } = pluginRegistry.getTermSize();
116
126
  const nextLayout = currentState.config.layout.floating.some((entry) => entry.instanceId === paneId)
117
- ? addPaneFloating(currentState.config.layout, duplicate, width, height, paneDef)
127
+ ? addPaneFloating(currentState.config.layout, duplicate, width, height, paneDef, { focusedPaneId: paneId })
118
128
  : addPaneToLayout(currentState.config.layout, duplicate, { relativeTo: paneId, position: "right" });
119
129
  persistLayoutChange(nextLayout);
120
130
  dispatch({ type: "FOCUS_PANE", paneId: duplicate.instanceId });
121
131
  }, [dispatch, persistLayoutChange, pluginRegistry, stateRef]);
122
132
 
123
133
  return {
134
+ changePaneTicker,
124
135
  duplicatePane,
125
136
  focusTicker,
126
137
  persistLayoutChange,
@@ -256,6 +256,12 @@ export function useCommandBarPaneTemplateActions({
256
256
  },
257
257
  };
258
258
  }
259
+ // Plain ticker search (the backtick, a pane header's ticker) changes the focused pane's ticker;
260
+ // a search DES opened keeps opening DES.
261
+ if (!routeAction && item.pickTicker) {
262
+ const pick = item.pickTicker;
263
+ return { ...item, action: () => pick("pane") };
264
+ }
259
265
  return item;
260
266
  }, [executeCollectionCommand, notify, openPaneTemplateDirect, pluginRegistry.paneTemplates]);
261
267
 
@@ -2,8 +2,8 @@ import { useLayoutEffect, useState } from "react";
2
2
  import { t, tf } from "../../../i18n";
3
3
  import { useThemeColors } from "../../../theme/theme-context";
4
4
  import { Box, Text, TextAttributes } from "../../../ui";
5
- import { truncateToDisplayWidth } from "../../../utils/format";
6
- import { Button } from "../../ui";
5
+ import { displayWidth, truncateToDisplayWidth } from "../../../utils/format";
6
+ import { Button, terminalButtonColumns } from "../../ui";
7
7
  import type { ListScreenState } from "../list/model";
8
8
  import { CommandBarListBody } from "../list/view";
9
9
  import { ThemePicker } from "../theme-picker";
@@ -18,6 +18,13 @@ import type { CommandBarPanelProps } from "./types";
18
18
 
19
19
  const COMMAND_BAR_OVERLAY_Z_INDEX = 2_147_483_646;
20
20
  const COMMAND_BAR_PANEL_Z_INDEX = 2_147_483_647;
21
+ const NEW_PANE_LABEL = "New pane";
22
+
23
+ /** Ticker search's title when Enter changes a pane: the pane's name gives way first. */
24
+ function changeTickerTitle(pane: string, width: number): string {
25
+ const full = tf("Change ticker · {pane}", { pane });
26
+ return displayWidth(full) <= width ? full : truncateToDisplayWidth(t("Change ticker"), width);
27
+ }
21
28
 
22
29
  /**
23
30
  * The root screen keeps the closed prompt's own words. Opening the bar puts the
@@ -68,9 +75,12 @@ export function CommandBarPanel({
68
75
  themePickerFilter,
69
76
  themePickerRef,
70
77
  trailingWidth,
78
+ tickerSearchTarget = null,
79
+ onRunSecondary,
71
80
  visibleListState,
72
81
  }: CommandBarPanelProps) {
73
82
  const colors = useThemeColors();
83
+ const newPaneColumns = terminalButtonColumns({ label: NEW_PANE_LABEL, shortcut: "Shift+Enter", compact: true });
74
84
  const palette = useCommandBarPalette(nativePaneChrome);
75
85
  // The count already includes this opening, so this reads the same until the bar closes.
76
86
  const intro = useAppSelector((state) => showsCommandBarIntro(state.config));
@@ -191,8 +201,25 @@ export function CommandBarPanel({
191
201
  />
192
202
  <Box width={2} />
193
203
  <Text fg={palette.text} attributes={TextAttributes.BOLD}>
194
- {truncateToDisplayWidth(t(getCommandBarPanelTitle(currentRoute)), Math.max(1, queryDisplayWidth - 8))}
204
+ {tickerSearchTarget
205
+ ? changeTickerTitle(tickerSearchTarget, Math.max(1, queryDisplayWidth - 8 - newPaneColumns - 2))
206
+ : truncateToDisplayWidth(t(getCommandBarPanelTitle(currentRoute)), Math.max(1, queryDisplayWidth - 8))}
195
207
  </Text>
208
+ {tickerSearchTarget && (
209
+ <>
210
+ <Box flexGrow={1} />
211
+ {/* Enter changes the pane; opening another one is the secondary action. */}
212
+ <Button
213
+ label={NEW_PANE_LABEL}
214
+ variant="plain"
215
+ compact
216
+ flush
217
+ stopPropagation
218
+ shortcut="Shift+Enter"
219
+ onPress={onRunSecondary}
220
+ />
221
+ </>
222
+ )}
196
223
  </>
197
224
  ) : rootShortcutFeedback ? (
198
225
  // Says what Enter runs, and a click on it runs the same.
@@ -46,5 +46,12 @@ export interface CommandBarPanelProps {
46
46
  themePickerFilter: string;
47
47
  themePickerRef: RefObject<ThemePickerHandle | null>;
48
48
  trailingWidth: number;
49
+ /**
50
+ * Ticker search's Enter changes this pane's ticker (its title, as its header shows it): the
51
+ * chrome row says so and offers the new pane the secondary action opens. Null otherwise.
52
+ */
53
+ tickerSearchTarget?: string | null;
54
+ /** Runs the selected row's secondary action, as Shift+Enter does. */
55
+ onRunSecondary?: () => void;
49
56
  visibleListState: ListScreenState | null;
50
57
  }
@@ -13,7 +13,7 @@ import {
13
13
  type AssistRowHandlers,
14
14
  } from "../../assist/model";
15
15
  import { matchPrefix, type Command } from "../../commands/registry";
16
- import { isCollectionCommand } from "../../helpers";
16
+ import { isCollectionCommand, SECURITY_DESCRIPTION_SEARCH } from "../../helpers";
17
17
  import { recentPaneTemplateArg } from "../../pane-templates/items";
18
18
  import { dedupeById } from "../../view-model";
19
19
  import type { ResultItem } from "../../list/model";
@@ -74,7 +74,7 @@ export interface RootResultModelOptions {
74
74
  hasPaneSettings: (paneId: string) => boolean;
75
75
  localTickerSearchResultItems: (query?: string, options?: { category?: string; limit?: number }) => ResultItem[];
76
76
  nonShortcutPaneTemplateItems: (filterQuery?: string) => ResultItem[];
77
- openModeRoute: (screen: "ticker-search" | "layout", initialQuery?: string) => void;
77
+ openModeRoute: (screen: "ticker-search" | "layout", initialQuery?: string, payload?: Record<string, unknown>) => void;
78
78
  paneShortcutItems: (options?: PaneShortcutItemsOptions) => ResultItem[];
79
79
  pluginCommandItems: () => ResultItem[];
80
80
  pluginCommandResultItems: (command: CommandDef, shortcutArg: string) => ResultItem[];
@@ -336,7 +336,7 @@ export function buildRootResultModel(options: RootResultModelOptions): RootResul
336
336
  detail: "Open security details after resolving a ticker",
337
337
  category: "Search",
338
338
  kind: "command",
339
- action: () => openModeRoute("ticker-search", ""),
339
+ action: () => openModeRoute("ticker-search", "", SECURITY_DESCRIPTION_SEARCH),
340
340
  });
341
341
  } else if (match.arg) {
342
342
  items.push(...localTickerSearchResultItems(match.arg, { limit: 6 }));
@@ -372,7 +372,7 @@ export function buildRootResultModel(options: RootResultModelOptions): RootResul
372
372
  templatesForCode: getAvailablePaneShortcutTemplates,
373
373
  createTemplateItem: (template) => createPaneTemplateItem(template, { showShortcut: true }),
374
374
  lookUpCompany: availableCommands.some((command) => command.id === "security-description")
375
- ? () => openModeRoute("ticker-search", "")
375
+ ? () => openModeRoute("ticker-search", "", SECURITY_DESCRIPTION_SEARCH)
376
376
  : null,
377
377
  }));
378
378
  }
@@ -9,6 +9,7 @@ import {
9
9
  getCollectionCommandAction,
10
10
  getCollectionCommandVerb,
11
11
  isCollectionCommand,
12
+ SECURITY_DESCRIPTION_SEARCH,
12
13
  type CollectionCommandId,
13
14
  } from "../../helpers";
14
15
  import type { ResultItem } from "../../list/model";
@@ -83,7 +84,7 @@ export function acceptRootShortcutTabAction(options: RootSelectionCommandOptions
83
84
  }
84
85
 
85
86
  if (intent.command.id === "security-description") {
86
- options.openModeRoute("ticker-search", intent.argText);
87
+ options.openModeRoute("ticker-search", intent.argText, SECURITY_DESCRIPTION_SEARCH);
87
88
  return true;
88
89
  }
89
90
  if (isCollectionCommand(intent.command.id)) {
@@ -151,7 +152,7 @@ export function buildImmediateRootSelection(options: RootSelectionCommandOptions
151
152
  detail: "Open security details for a ticker",
152
153
  category: "Search",
153
154
  kind: "command",
154
- action: () => options.openModeRoute("ticker-search", ""),
155
+ action: () => options.openModeRoute("ticker-search", "", SECURITY_DESCRIPTION_SEARCH),
155
156
  };
156
157
  }
157
158
  return {
@@ -16,7 +16,7 @@ import {
16
16
  type TickerSearchCandidate,
17
17
  type TickerSearchInstrumentClass,
18
18
  } from "../../../../tickers/search";
19
- import type { ResultItem } from "../../list/model";
19
+ import type { ResultItem, TickerPick } from "../../list/model";
20
20
  import { delistingLabel, parseListingDelisting } from "../../../../market-data/quotes/delisting";
21
21
  import {
22
22
  buildTickerSearchCacheKey,
@@ -25,6 +25,8 @@ import {
25
25
  } from "./results";
26
26
 
27
27
  interface UseCommandBarTickerSearchActionsOptions {
28
+ /** Ticker search's Enter: the focused pane, or its linked group, takes the ticker. */
29
+ changePaneTicker?: (symbol: string, options?: PinTickerOptions) => void;
28
30
  closeAll: (options?: { revertThemePreview?: boolean }) => void;
29
31
  dispatch: (action: any) => void;
30
32
  focusTicker: (symbol: string, options?: PinTickerOptions) => void;
@@ -34,6 +36,7 @@ interface UseCommandBarTickerSearchActionsOptions {
34
36
  }
35
37
 
36
38
  export function useCommandBarTickerSearchActions({
39
+ changePaneTicker,
37
40
  closeAll,
38
41
  dispatch,
39
42
  focusTicker,
@@ -55,13 +58,18 @@ export function useCommandBarTickerSearchActions({
55
58
  return ticker;
56
59
  }, [dispatch, pluginRegistry.events, tickerRepository]);
57
60
 
58
- const openTickerResearch = useCallback((result: InstrumentSearchResult, options?: { forceNewPane?: boolean }) => {
61
+ const pickTicker = useCallback((symbol: string, selection: PinTickerOptions, how: TickerPick) => {
62
+ if (how === "pane" && changePaneTicker) changePaneTicker(symbol, selection);
63
+ else focusTicker(symbol, how === "new" ? { forceNewPane: true, ...selection } : selection);
64
+ closeAll({ revertThemePreview: false });
65
+ }, [changePaneTicker, closeAll, focusTicker]);
66
+
67
+ const openTickerResearch = useCallback((result: InstrumentSearchResult, how: TickerPick) => {
59
68
  (async () => {
60
69
  const ticker = await resolveSearchTicker(result);
61
- focusTicker(ticker.metadata.ticker, { ...options, ...tickerSelectionFromSearchResult(result) });
62
- closeAll({ revertThemePreview: false });
70
+ pickTicker(ticker.metadata.ticker, tickerSelectionFromSearchResult(result), how);
63
71
  })();
64
- }, [closeAll, focusTicker, resolveSearchTicker]);
72
+ }, [pickTicker, resolveSearchTicker]);
65
73
 
66
74
  const mapTickerSearchCandidateToResultItem = useCallback((candidate: TickerSearchCandidate): ResultItem => {
67
75
  const detail = formatTickerSearchDetail(candidate);
@@ -80,6 +88,7 @@ export function useCommandBarTickerSearchActions({
80
88
  const lines = delisting ? [{ segments: [{ text: delistingLabel(delisting), emphasis: "muted" as const }] }] : undefined;
81
89
 
82
90
  if (candidate.kind === "ticker" && candidate.ticker) {
91
+ const pick = (how: TickerPick) => pickTicker(candidate.ticker!.metadata.ticker, tickerSelectionFromSearchResult(candidate.result), how);
83
92
  return {
84
93
  id: candidate.id,
85
94
  contractKey: candidate.contractKey,
@@ -95,14 +104,9 @@ export function useCommandBarTickerSearchActions({
95
104
  kind: "ticker",
96
105
  resolveTicker: async () => candidate.ticker!,
97
106
  prefetchInstrument: rowPrefetchInstrument(candidate, tickersRef.current),
98
- secondaryAction: () => {
99
- focusTicker(candidate.ticker!.metadata.ticker, { forceNewPane: true, ...tickerSelectionFromSearchResult(candidate.result) });
100
- closeAll({ revertThemePreview: false });
101
- },
102
- action: () => {
103
- focusTicker(candidate.ticker!.metadata.ticker, { ...tickerSelectionFromSearchResult(candidate.result) });
104
- closeAll({ revertThemePreview: false });
105
- },
107
+ pickTicker: pick,
108
+ secondaryAction: () => pick("new"),
109
+ action: () => pick("des"),
106
110
  };
107
111
  }
108
112
 
@@ -126,10 +130,11 @@ export function useCommandBarTickerSearchActions({
126
130
  : candidate.result!.exchange || candidate.result!.primaryExchange,
127
131
  )),
128
132
  prefetchInstrument: rowPrefetchInstrument(candidate, tickersRef.current),
129
- secondaryAction: () => openTickerResearch(candidate.result!, { forceNewPane: true }),
130
- action: () => openTickerResearch(candidate.result!),
133
+ pickTicker: (how) => openTickerResearch(candidate.result!, how),
134
+ secondaryAction: () => openTickerResearch(candidate.result!, "new"),
135
+ action: () => openTickerResearch(candidate.result!, "des"),
131
136
  };
132
- }, [closeAll, focusTicker, openTickerResearch, resolveSearchTicker]);
137
+ }, [openTickerResearch, pickTicker, resolveSearchTicker]);
133
138
 
134
139
  const buildTickerSearchResultItems = useCallback((candidates: TickerSearchCandidate[], query: string): ResultItem[] => (
135
140
  candidates.length > 0
@@ -1,5 +1,6 @@
1
1
  import { useEffect, useRef } from "react";
2
2
  import type { AppState } from "../../../state/app/context";
3
+ import type { TickerSearchPayload } from "../../../core/state/app/command-bar-launch";
3
4
 
4
5
  interface UseCommandBarLaunchRequestOptions {
5
6
  commandBarLaunchRequest: AppState["commandBarLaunchRequest"];
@@ -7,7 +8,7 @@ interface UseCommandBarLaunchRequestOptions {
7
8
  openModeRoute: (
8
9
  screen: "ticker-search" | "layout",
9
10
  initialQuery?: string,
10
- payload?: Record<string, unknown>,
11
+ payload?: TickerSearchPayload,
11
12
  ) => void;
12
13
  }
13
14
 
@@ -29,7 +30,7 @@ export function useCommandBarLaunchRequest({
29
30
  processedLaunchSequenceRef.current = launch.sequence;
30
31
 
31
32
  if (launch.kind === "ticker-search") {
32
- openModeRoute("ticker-search", launch.query ?? "");
33
+ openModeRoute("ticker-search", launch.query ?? "", launch.payload);
33
34
  }
34
35
  // Submitting text needs the selection runtime, which the surface wires up
35
36
  // after this hook; it watches for run-query itself.
@@ -107,7 +107,10 @@ function buildRouteListState(options: BuildRouteListStateOptions): ListScreenSta
107
107
  return {
108
108
  kind: "mode",
109
109
  title: "Security Description",
110
- subtitle: "Resolve a ticker, then open its Ticker Research pane.",
110
+ // DES opens a research pane; the backtick's search changes the focused pane's ticker.
111
+ subtitle: currentRoute.payload?.action
112
+ ? "Resolve a ticker, then open its Ticker Research pane."
113
+ : "Resolve a ticker for the focused pane, or open it in a new pane.",
111
114
  query: currentRoute.query,
112
115
  selectedIdx: currentRoute.selectedIdx,
113
116
  hoveredIdx: currentRoute.hoveredIdx,
@@ -36,6 +36,9 @@ import { useCommandBarRouteEffects } from "../routing/effects";
36
36
  import { useCommandBarEnvironment } from "./environment";
37
37
  import { useCommandBarActionRuntime } from "../action-runtime";
38
38
  import { requestKeybindingCapture } from "../../../app/keybindings";
39
+ import { resolveTickerRetargetPane } from "../../../layout/ticker-retarget";
40
+ import { findPaneInstance } from "../../../types/config";
41
+ import { getBasePaneDisplayTitle } from "../../layout/pane/title";
39
42
  import { isDialogOpen } from "../../../ui/dialog-stack";
40
43
 
41
44
  interface CommandBarProps {
@@ -635,7 +638,18 @@ export function CommandBar({
635
638
  visibleListStateRef,
636
639
  });
637
640
 
641
+ // Plain ticker search changes the focused pane's ticker when it shows one; DES's own search opens DES.
642
+ const tickerSearchTarget = useMemo(() => {
643
+ if (currentRoute?.kind !== "mode" || currentRoute.screen !== "ticker-search" || currentRoute.payload?.action) return null;
644
+ const layout = state.config.layout;
645
+ if (!resolveTickerRetargetPane(layout, state.focusedPaneId, pluginRegistry.panes)) return null;
646
+ const focused = findPaneInstance(layout, state.focusedPaneId!);
647
+ const paneDef = focused ? pluginRegistry.panes.get(focused.paneId) : undefined;
648
+ return focused && paneDef ? getBasePaneDisplayTitle(state, focused, paneDef, pluginRegistry.panes) : null;
649
+ }, [currentRoute, pluginRegistry.panes, state]);
650
+ const runSecondary = useCallback(() => activateListSelection({ secondary: true }), [activateListSelection]);
651
+
638
652
  return (
639
- <CommandBarPanel {...panelProps} />
653
+ <CommandBarPanel {...panelProps} tickerSearchTarget={tickerSearchTarget} onRunSecondary={runSecondary} />
640
654
  );
641
655
  }
@@ -11,6 +11,12 @@ import { resolvePaneBodyFrame, shouldReservePaneFooter } from "./pane/sizing";
11
11
  interface FloatingPaneWrapperProps {
12
12
  paneId?: string;
13
13
  title: string;
14
+ /**
15
+ * Desktop and web: the ticker the title shows, drawn as a control that opens ticker search for
16
+ * the pane (`onTitleTickerPress`).
17
+ */
18
+ titleTicker?: string | null;
19
+ onTitleTickerPress?: () => void;
14
20
  x: number;
15
21
  y: number;
16
22
  width: number;
@@ -68,6 +74,8 @@ function TerminalFloatingPaneBorder({ width, height }: { width: number; height:
68
74
  export function FloatingPaneWrapper({
69
75
  paneId,
70
76
  title,
77
+ titleTicker = null,
78
+ onTitleTickerPress,
71
79
  x,
72
80
  y,
73
81
  width,
@@ -135,6 +143,8 @@ export function FloatingPaneWrapper({
135
143
  >
136
144
  <PaneHeader
137
145
  title={title}
146
+ titleTicker={titleTicker}
147
+ onTitleTickerPress={onTitleTickerPress}
138
148
  width={width}
139
149
  focused={focused}
140
150
  windowModeSelected={windowModeSelected}
@@ -3,6 +3,8 @@ import { Box } from "../../../ui";
3
3
  import { colors } from "../../../theme/colors";
4
4
  import { PaneSurfaceContext } from "./surface";
5
5
 
6
+ export type DockEdge = "left" | "right" | "top" | "bottom";
7
+
6
8
  export function getPaneWindowAttributes({
7
9
  enabled = true,
8
10
  role,
@@ -11,6 +13,7 @@ export function getPaneWindowAttributes({
11
13
  focused,
12
14
  windowModeSelected,
13
15
  showBorderColor = false,
16
+ dockEdges,
14
17
  }: {
15
18
  enabled?: boolean;
16
19
  role: string;
@@ -19,6 +22,8 @@ export function getPaneWindowAttributes({
19
22
  focused: boolean;
20
23
  windowModeSelected?: boolean;
21
24
  showBorderColor?: boolean;
25
+ /** A docked pane's sides that face another pane across the gap between them, which it rules. */
26
+ dockEdges?: readonly DockEdge[];
22
27
  }): Record<string, unknown> {
23
28
  const attributes: Record<string, unknown> = {
24
29
  "data-gloom-role": role,
@@ -31,6 +36,7 @@ export function getPaneWindowAttributes({
31
36
  if (windowModeSelected != null) {
32
37
  attributes["data-window-mode-selected"] = windowModeSelected ? "true" : "false";
33
38
  }
39
+ if (dockEdges && dockEdges.length > 0) attributes["data-dock-edges"] = dockEdges.join(" ");
34
40
  if (showBorderColor) {
35
41
  attributes.style = {
36
42
  "--pane-border-color": focused || windowModeSelected ? colors.borderFocused : colors.border,