gloomberb 0.19.4 → 0.19.6

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 (321) hide show
  1. package/package.json +3 -1
  2. package/patches/@opentui%2Fcore@0.3.2.patch +86 -25
  3. package/src/api-client/equity-screener.ts +23 -0
  4. package/src/app/pane-runtime/index.tsx +2 -0
  5. package/src/app/pane-runtime/plugin-bindings.ts +10 -1
  6. package/src/app.tsx +63 -16
  7. package/src/cli/commands/command-utils.ts +4 -0
  8. package/src/cli/commands/market.ts +264 -33
  9. package/src/cli/commands/search.ts +22 -4
  10. package/src/cli/commands/ticker.ts +84 -39
  11. package/src/cli/currency-name-hint.ts +60 -0
  12. package/src/cli/glossary.ts +3 -3
  13. package/src/cli/history-rows.ts +18 -1
  14. package/src/cli/known-gaps.ts +25 -2
  15. package/src/cli/listing-arg.ts +12 -0
  16. package/src/cli/not-a-ticker.ts +5 -3
  17. package/src/cli/pane-functions/capabilities.ts +2 -0
  18. package/src/cli/pane-functions/catalog.ts +31 -5
  19. package/src/cli/pane-functions/function-help.ts +8 -5
  20. package/src/cli/pane-functions/headless.ts +11 -6
  21. package/src/cli/pane-functions/market-session.ts +6 -7
  22. package/src/cli/pane-functions/resolver.ts +75 -2
  23. package/src/cli/quote-answer.ts +9 -0
  24. package/src/cli/series-search.ts +4 -5
  25. package/src/cli/symbol-list.ts +54 -2
  26. package/src/cli/symbol-rows.ts +14 -2
  27. package/src/cli/ticker-resolution.ts +89 -20
  28. package/src/components/chart/composite/axis-overlays.tsx +60 -27
  29. package/src/components/chart/composite/composite-chart.tsx +118 -63
  30. package/src/components/chart/composite/cursor-source.ts +111 -0
  31. package/src/components/chart/composite/format.ts +168 -6
  32. package/src/components/chart/composite/legend.tsx +8 -4
  33. package/src/components/chart/composite/panel-bitmap.ts +28 -2
  34. package/src/components/chart/composite/panel-labels.ts +20 -1
  35. package/src/components/chart/composite/panel-surface.tsx +201 -92
  36. package/src/components/chart/composite/price-axis-labels.tsx +92 -46
  37. package/src/components/chart/composite/price-series.ts +31 -8
  38. package/src/components/chart/composite/scene.ts +154 -59
  39. package/src/components/chart/composite/series-axis-tags.tsx +4 -2
  40. package/src/components/chart/composite/time-axis.ts +30 -7
  41. package/src/components/chart/composite/time-scale.ts +211 -56
  42. package/src/components/chart/composite/types.ts +11 -1
  43. package/src/components/chart/composite/use-composite-chart-keyboard.ts +32 -12
  44. package/src/components/chart/curve/curve-surface.tsx +5 -2
  45. package/src/components/chart/curve/model.ts +4 -1
  46. package/src/components/chart/native/use-bitmap-metrics.ts +81 -0
  47. package/src/components/chart/static/series.ts +3 -0
  48. package/src/components/command-bar/commands/collection-list.ts +81 -0
  49. package/src/components/command-bar/commands/direct/index.ts +6 -0
  50. package/src/components/command-bar/commands/registry.ts +8 -0
  51. package/src/components/command-bar/layout-items/current-layout.ts +22 -1
  52. package/src/components/command-bar/layout-items/focused-pane.ts +22 -1
  53. package/src/components/command-bar/pane-templates/items.ts +19 -3
  54. package/src/components/command-bar/pane-templates/workflow.ts +5 -0
  55. package/src/components/command-bar/routes/root/results.ts +23 -3
  56. package/src/components/command-bar/routes/root/selection.ts +4 -2
  57. package/src/components/command-bar/routes/root/shortcut-feedback.ts +1 -1
  58. package/src/components/command-bar/routes/root/shortcut-items.ts +3 -4
  59. package/src/components/command-bar/routes/root/shortcuts.ts +58 -14
  60. package/src/components/command-bar/routes/root/ticker-first.ts +32 -0
  61. package/src/components/command-bar/surface/environment.ts +2 -0
  62. package/src/components/command-bar/view-model.ts +7 -0
  63. package/src/components/command-bar/workflow/ops.ts +2 -1
  64. package/src/components/command-bar/workflow/tickers.ts +20 -0
  65. package/src/components/layout/shell/active-drag.ts +38 -7
  66. package/src/components/layout/shell/drag/magnets.ts +106 -0
  67. package/src/components/layout/shell/menu.ts +15 -1
  68. package/src/components/layout/shell/pane/actions.ts +4 -0
  69. package/src/components/layout/shell/ticker-link-menu.ts +12 -3
  70. package/src/components/layout/status-bar.tsx +20 -0
  71. package/src/components/layout/window-controls.tsx +96 -35
  72. package/src/components/layout/window-fullscreen.ts +20 -0
  73. package/src/components/onboarding/onboarding-keyboard.ts +5 -1
  74. package/src/components/onboarding/onboarding-wizard.tsx +15 -4
  75. package/src/components/onboarding/portfolio-step/positions-panel.tsx +8 -5
  76. package/src/components/onboarding/use-onboarding-progress.ts +20 -1
  77. package/src/components/price-sparkline/view.tsx +14 -6
  78. package/src/components/quote-flash.ts +36 -32
  79. package/src/components/ticker/badge/index.tsx +8 -4
  80. package/src/components/ticker/badge/list.tsx +23 -7
  81. package/src/components/ui/column-grid.tsx +8 -2
  82. package/src/components/ui/data-table/opentui/model.ts +4 -1
  83. package/src/components/ui/tabs.tsx +5 -2
  84. package/src/core/state/app/layout.ts +18 -3
  85. package/src/core/state/app/state.ts +2 -0
  86. package/src/core/state/app/types.ts +5 -0
  87. package/src/data/config/layout.ts +3 -0
  88. package/src/data/config/store/normalize.ts +39 -4
  89. package/src/i18n/es.ts +10 -0
  90. package/src/i18n/ja.ts +10 -0
  91. package/src/i18n/ko.ts +10 -0
  92. package/src/i18n/zh-cn.ts +10 -0
  93. package/src/i18n/zh-tw.ts +10 -0
  94. package/src/layout/pane-manager/floating-placement.ts +7 -4
  95. package/src/layout/pane-manager/floating.ts +5 -2
  96. package/src/market-data/bond-funds.ts +19 -0
  97. package/src/market-data/coordinator/events.ts +17 -1
  98. package/src/market-data/frame-scheduler.ts +47 -10
  99. package/src/market-data/frame-wake.ts +74 -0
  100. package/src/market-data/futures-board.ts +7 -6
  101. package/src/market-data/futures-contract.ts +14 -3
  102. package/src/market-data/hooks.tsx +12 -3
  103. package/src/market-data/market/freshness.ts +18 -0
  104. package/src/market-data/market/status.ts +15 -2
  105. package/src/market-data/performance.ts +78 -9
  106. package/src/market-data/request-types.ts +6 -3
  107. package/src/plugins/builtin/alerts/cli.ts +2 -1
  108. package/src/plugins/builtin/analytics/risk-evidence.ts +1 -0
  109. package/src/plugins/builtin/attention/evidence.ts +1 -1
  110. package/src/plugins/builtin/awards/client.ts +1 -1
  111. package/src/plugins/builtin/awards/evidence.ts +1 -1
  112. package/src/plugins/builtin/awards/pane.tsx +2 -1
  113. package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
  114. package/src/plugins/builtin/bond-calculator/index.tsx +1 -1
  115. package/src/plugins/builtin/bond-calculator/math.ts +1 -1
  116. package/src/plugins/builtin/bond-calculator/model.ts +14 -5
  117. package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
  118. package/src/plugins/builtin/broker-manager/footer.ts +3 -2
  119. package/src/plugins/builtin/broker-manager/index.tsx +2 -1
  120. package/src/plugins/builtin/broker-manager/keyboard.ts +2 -1
  121. package/src/plugins/builtin/buildout/cells.tsx +25 -45
  122. package/src/plugins/builtin/buildout/detail/company.tsx +3 -3
  123. package/src/plugins/builtin/buildout/detail/index.tsx +1 -1
  124. package/src/plugins/builtin/buildout/detail/intel.tsx +4 -7
  125. package/src/plugins/builtin/buildout/detail/site.tsx +4 -4
  126. package/src/plugins/builtin/buildout/detail/ui.tsx +39 -38
  127. package/src/plugins/builtin/buildout/format.ts +23 -1
  128. package/src/plugins/builtin/buildout/model/types.ts +1 -0
  129. package/src/plugins/builtin/buildout/pane/index.tsx +2 -8
  130. package/src/plugins/builtin/buildout/table-model.ts +12 -4
  131. package/src/plugins/builtin/catalysts/evidence.ts +1 -1
  132. package/src/plugins/builtin/catalysts/pane.tsx +2 -1
  133. package/src/plugins/builtin/cds/headless.ts +1 -0
  134. package/src/plugins/builtin/cds/index.tsx +1 -1
  135. package/src/plugins/builtin/chart-composer/headless.ts +40 -1
  136. package/src/plugins/builtin/cloud/plugin.tsx +2 -0
  137. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +28 -3
  138. package/src/plugins/builtin/cloud-tweets/table.tsx +3 -2
  139. package/src/plugins/builtin/comment-letters/client.ts +2 -1
  140. package/src/plugins/builtin/company-kpis/client.ts +1 -1
  141. package/src/plugins/builtin/company-kpis/pane.tsx +2 -1
  142. package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +3 -2
  143. package/src/plugins/builtin/correlation/headless.ts +3 -2
  144. package/src/plugins/builtin/cot/headless.ts +9 -3
  145. package/src/plugins/builtin/cot/model.ts +44 -3
  146. package/src/plugins/builtin/credit-documents/client.ts +1 -1
  147. package/src/plugins/builtin/credit-documents/evidence.ts +1 -1
  148. package/src/plugins/builtin/credit-documents/pane.tsx +2 -1
  149. package/src/plugins/builtin/crypto-board/pane.tsx +5 -4
  150. package/src/plugins/builtin/debt-maturities/headless.ts +11 -2
  151. package/src/plugins/builtin/debt-maturities/model.ts +66 -0
  152. package/src/plugins/builtin/debt-maturities/pane.tsx +23 -4
  153. package/src/plugins/builtin/earnings-calls/pane.tsx +1 -1
  154. package/src/plugins/builtin/earnings-ripple/index.tsx +6 -1
  155. package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
  156. package/src/plugins/builtin/econ/calendar-model.ts +30 -6
  157. package/src/plugins/builtin/econ/fred-catalog.ts +5 -5
  158. package/src/plugins/builtin/econ/print-watch.ts +3 -1
  159. package/src/plugins/builtin/equity-screener/client.ts +1 -1
  160. package/src/plugins/builtin/equity-screener/criterion-editor.tsx +4 -16
  161. package/src/plugins/builtin/equity-screener/headless.ts +4 -2
  162. package/src/plugins/builtin/equity-screener/ideas.ts +67 -3
  163. package/src/plugins/builtin/equity-screener/model.ts +180 -12
  164. package/src/plugins/builtin/equity-screener/pane.tsx +52 -12
  165. package/src/plugins/builtin/equity-screener/screen-check.ts +7 -4
  166. package/src/plugins/builtin/equity-screener/watchlist.ts +33 -0
  167. package/src/plugins/builtin/futures/series.ts +16 -1
  168. package/src/plugins/builtin/futures-curve/client.ts +19 -0
  169. package/src/plugins/builtin/futures-curve/headless.ts +52 -13
  170. package/src/plugins/builtin/futures-curve/index.tsx +1 -1
  171. package/src/plugins/builtin/futures-curve/model.ts +77 -6
  172. package/src/plugins/builtin/futures-curve/pane.tsx +19 -3
  173. package/src/plugins/builtin/fx-matrix/headless.ts +4 -2
  174. package/src/plugins/builtin/fx-matrix/index.tsx +37 -3
  175. package/src/plugins/builtin/fx-matrix/pairs.ts +15 -0
  176. package/src/plugins/builtin/gpu/headless.ts +2 -1
  177. package/src/plugins/builtin/help/function-card.tsx +2 -1
  178. package/src/plugins/builtin/help/index.tsx +2 -1
  179. package/src/plugins/builtin/insider/display.ts +45 -6
  180. package/src/plugins/builtin/ipo-calendar/model.ts +2 -0
  181. package/src/plugins/builtin/iv-history/client.ts +2 -1
  182. package/src/plugins/builtin/iv-history/headless.ts +2 -1
  183. package/src/plugins/builtin/jobs/pages.ts +4 -4
  184. package/src/plugins/builtin/kelly-sizer/headless.ts +2 -1
  185. package/src/plugins/builtin/macro-day/client.ts +41 -0
  186. package/src/plugins/builtin/macro-day/headless.ts +19 -9
  187. package/src/plugins/builtin/macro-day/model.ts +3 -1
  188. package/src/plugins/builtin/market-heatmap/index.tsx +2 -1
  189. package/src/plugins/builtin/market-movers/index.tsx +4 -3
  190. package/src/plugins/builtin/members/client.ts +1 -1
  191. package/src/plugins/builtin/mna/distress/client.ts +1 -0
  192. package/src/plugins/builtin/mna/distress/headless.ts +1 -0
  193. package/src/plugins/builtin/mna/pane.tsx +4 -1
  194. package/src/plugins/builtin/options/market-reference.ts +1 -1
  195. package/src/plugins/builtin/options/open-interest-as-of.ts +3 -1
  196. package/src/plugins/builtin/options/view.tsx +2 -1
  197. package/src/plugins/builtin/options-calculator/evidence.ts +1 -1
  198. package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
  199. package/src/plugins/builtin/options-scenario/csp-screen.ts +8 -4
  200. package/src/plugins/builtin/options-scenario/csp.ts +28 -9
  201. package/src/plugins/builtin/options-scenario/evidence.ts +5 -4
  202. package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
  203. package/src/plugins/builtin/perps/client.ts +1 -1
  204. package/src/plugins/builtin/perps/pane.tsx +3 -1
  205. package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +17 -0
  206. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +2 -1
  207. package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +4 -2
  208. package/src/plugins/builtin/portfolio-list/pane/index.tsx +7 -3
  209. package/src/plugins/builtin/portfolio-list/use-throttled-memo.ts +10 -19
  210. package/src/plugins/builtin/rate-path/headless.ts +24 -10
  211. package/src/plugins/builtin/research/analyst-model.ts +1 -0
  212. package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +2 -1
  213. package/src/plugins/builtin/research/event-model.ts +10 -3
  214. package/src/plugins/builtin/research/events-headless.ts +20 -2
  215. package/src/plugins/builtin/research/index.tsx +1 -0
  216. package/src/plugins/builtin/research/relative-valuation-currency.ts +1 -1
  217. package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -1
  218. package/src/plugins/builtin/research-search/command-bar-search.ts +3 -1
  219. package/src/plugins/builtin/research-search/snippet.ts +1 -0
  220. package/src/plugins/builtin/revenue-breakdown/client.ts +3 -2
  221. package/src/plugins/builtin/seasonality/headless.ts +2 -1
  222. package/src/plugins/builtin/sec/command-bar-search.ts +3 -2
  223. package/src/plugins/builtin/sec/fund-facts.ts +17 -1
  224. package/src/plugins/builtin/sec/index.tsx +8 -5
  225. package/src/plugins/builtin/sec/row-summaries.ts +28 -12
  226. package/src/plugins/builtin/shared/members-menu.tsx +103 -38
  227. package/src/plugins/builtin/short-interest/publications-model.ts +22 -1
  228. package/src/plugins/builtin/short-interest/publications-pane.tsx +13 -4
  229. package/src/plugins/builtin/short-interest/watch-client.ts +2 -1
  230. package/src/plugins/builtin/short-interest/watch-model.ts +1 -1
  231. package/src/plugins/builtin/social-mentions/client.ts +2 -1
  232. package/src/plugins/builtin/supply-chain/client.ts +1 -1
  233. package/src/plugins/builtin/supply-chain/evidence.ts +1 -1
  234. package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -1
  235. package/src/plugins/builtin/supply-chain/pane.tsx +2 -1
  236. package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +1 -1
  237. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +24 -4
  238. package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +1 -1
  239. package/src/plugins/builtin/time-sales/client.ts +1 -0
  240. package/src/plugins/builtin/time-sales/pane.tsx +3 -2
  241. package/src/plugins/builtin/trace-bonds/client.ts +7 -4
  242. package/src/plugins/builtin/trace-bonds/index.tsx +1 -1
  243. package/src/plugins/builtin/vol-surface/client.ts +2 -1
  244. package/src/plugins/builtin/volatility/client.ts +6 -1
  245. package/src/plugins/builtin/volatility/headless.ts +0 -1
  246. package/src/plugins/builtin/yield-curve/curves.ts +15 -0
  247. package/src/plugins/builtin/yield-curve/headless.ts +9 -2
  248. package/src/plugins/builtin/yield-curve/index.tsx +5 -8
  249. package/src/plugins/host-modules.ts +22 -3
  250. package/src/plugins/host-smoke.ts +6 -3
  251. package/src/portfolio/collection-name.ts +19 -0
  252. package/src/portfolio/column-values.ts +76 -10
  253. package/src/renderers/browser/http-proxy-transport.ts +78 -8
  254. package/src/renderers/cloudflare/http-proxy.ts +13 -2
  255. package/src/renderers/cloudflare/proxy-session.ts +47 -24
  256. package/src/renderers/cloudflare/worker.ts +15 -2
  257. package/src/renderers/desktop/geometry.ts +279 -0
  258. package/src/renderers/desktop/screen-setup.ts +246 -0
  259. package/src/renderers/desktop/sequential-window-host.ts +179 -0
  260. package/src/renderers/desktop/test-utils.ts +71 -0
  261. package/src/renderers/desktop/window-controller.ts +433 -0
  262. package/src/renderers/desktop/window-host.ts +70 -0
  263. package/src/renderers/desktop/window-layouts.ts +630 -0
  264. package/src/renderers/dom/data-frames.ts +15 -4
  265. package/src/renderers/dom/host/box.tsx +204 -176
  266. package/src/renderers/dom/host/style.ts +49 -20
  267. package/src/renderers/dom/host/text.tsx +3 -2
  268. package/src/renderers/electrobun/bun/application-menu/click.ts +1 -0
  269. package/src/renderers/electrobun/bun/application-menu/index.ts +4 -1
  270. package/src/renderers/electrobun/bun/desktop/backend-requests.ts +19 -8
  271. package/src/renderers/electrobun/bun/desktop/backend.ts +322 -19
  272. package/src/renderers/electrobun/bun/desktop/detached-windows.ts +83 -61
  273. package/src/renderers/electrobun/bun/desktop/host-requests.ts +29 -15
  274. package/src/renderers/electrobun/bun/desktop/initialization.ts +30 -11
  275. package/src/renderers/electrobun/bun/desktop/relaunch.ts +9 -1
  276. package/src/renderers/electrobun/bun/desktop/screen-setup-file.ts +55 -0
  277. package/src/renderers/electrobun/bun/desktop/state-broadcaster.ts +44 -8
  278. package/src/renderers/electrobun/bun/desktop/windows-script.ts +9 -6
  279. package/src/renderers/electrobun/bun/desktop/workspace/index.ts +298 -97
  280. package/src/renderers/electrobun/bun/desktop/workspace/requests.ts +44 -6
  281. package/src/renderers/electrobun/bun/index.ts +4 -97
  282. package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +306 -0
  283. package/src/renderers/electrobun/bun/window/focus.ts +0 -25
  284. package/src/renderers/electrobun/bun/window/remembered-frame.ts +4 -82
  285. package/src/renderers/electrobun/bun/window/windows-native.ts +26 -1
  286. package/src/renderers/electrobun/shared/protocol.ts +50 -2
  287. package/src/renderers/electrobun/view/backend-rpc.ts +15 -0
  288. package/src/renderers/electrobun/view/desktop/window/bridge.ts +63 -3
  289. package/src/renderers/electrobun/view/main.tsx +13 -7
  290. package/src/renderers/electrobun/view/ui-host.tsx +7 -0
  291. package/src/renderers/electrobun/view/window-fullscreen.ts +10 -3
  292. package/src/series/fred-argument.ts +17 -0
  293. package/src/sources/provider-router/financial-routes.ts +7 -1
  294. package/src/sources/provider-router/index.ts +7 -1
  295. package/src/state/app/context/index.tsx +16 -2
  296. package/src/state/desktop-windows.ts +63 -0
  297. package/src/sync/other-window-tabs.ts +62 -0
  298. package/src/tickers/company-name-listing.ts +23 -3
  299. package/src/tickers/listing-fate.ts +147 -1
  300. package/src/tickers/terminal-codes.ts +5 -0
  301. package/src/time-series/price-units.ts +11 -0
  302. package/src/time-series/types.ts +6 -0
  303. package/src/types/config.ts +10 -1
  304. package/src/types/desktop-window.ts +71 -2
  305. package/src/types/financials.ts +4 -0
  306. package/src/types/headless.ts +19 -0
  307. package/src/types/plugin.ts +6 -0
  308. package/src/ui/host.tsx +2 -0
  309. package/src/ui/index.tsx +14 -13
  310. package/src/ui/same-props.ts +58 -0
  311. package/src/utils/cli-output.ts +33 -4
  312. package/src/utils/currency-names.ts +20 -0
  313. package/src/utils/currency-pair.ts +6 -0
  314. package/src/utils/exchange-rate-snapshot.ts +20 -2
  315. package/src/utils/format.ts +7 -2
  316. package/src/utils/futures-generic.ts +12 -0
  317. package/src/utils/fx-market-hours.ts +43 -0
  318. package/src/utils/http-proxy-upstream.ts +6 -2
  319. package/src/utils/plugin-proxy-hosts.json +0 -4
  320. package/src/utils/plugin-proxy-hosts.ts +22 -0
  321. package/src/utils/sec-filings.ts +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gloomberb",
3
- "version": "0.19.4",
3
+ "version": "0.19.6",
4
4
  "packageManager": "bun@1.3.14",
5
5
  "description": "Market research and portfolio tracker for the terminal",
6
6
  "module": "src/public/index.ts",
@@ -99,6 +99,7 @@
99
99
  "kit:page": "bun run scripts/pane-chrome/kit-page.ts",
100
100
  "audit:ui:compare": "bun run scripts/pane-chrome/ui-audit-compare.ts",
101
101
  "benchmark:pane-drag:compare": "bun run scripts/pane-chrome/frame-budget.ts",
102
+ "benchmark:pane-drag:smoothness": "bun run scripts/pane-chrome/drag-smoothness.ts",
102
103
  "test:global-upgrade": "bun run scripts/smoke-global-upgrade.ts",
103
104
  "release": "./scripts/release.sh"
104
105
  },
@@ -125,6 +126,7 @@
125
126
  "playwright-core": "1.60.0",
126
127
  "png-to-ico": "^2.1.8",
127
128
  "rcedit": "^4.0.1",
129
+ "resedit": "^3.1.0",
128
130
  "typescript": "^5.9.2",
129
131
  "wrangler": "^4.0.0"
130
132
  },
@@ -1,5 +1,5 @@
1
1
  diff --git a/index-218h9p3f.js b/index-218h9p3f.js
2
- index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac6c440d3c 100644
2
+ index b9445d2cca9477dfe06026da451b6d19268fcbdd..1f5795ab76800a64fdb0acf4a1ed018629f3ca17 100644
3
3
  --- a/index-218h9p3f.js
4
4
  +++ b/index-218h9p3f.js
5
5
  @@ -6487,17 +6487,27 @@ class MouseParser {
@@ -166,8 +166,55 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
166
166
  this.events.push({
167
167
  type: "mouse",
168
168
  raw: decodeLatin1(rawBytes),
169
- @@ -17995,6 +18029,8 @@ function isGapType(value) {
169
+ @@ -15733,6 +15767,9 @@ var yogaConfig = src_default.Config.create();
170
+ yogaConfig.setUseWebDefaults(false);
171
+ yogaConfig.setPointScaleFactor(1);
170
172
 
173
+ +/** Counts layout reads that found a node's layout changed (Renderable.updateFromLayout). */
174
+ +var layoutClock = 0;
175
+ +
176
+ class Renderable extends BaseRenderable {
177
+ static renderablesByNumber = new Map;
178
+ _isDestroyed = false;
179
+ @@ -15778,6 +15815,9 @@ class Renderable extends BaseRenderable {
180
+ childrenSortedByPrimaryAxis = [];
181
+ _shouldUpdateBefore = new Set;
182
+ _lastLayoutFrame = -1;
183
+ + _seenLayout = null;
184
+ + _layoutCheckedAt = -1;
185
+ + _layoutChangedAt = -1;
186
+ onLifecyclePass = null;
187
+ renderBefore;
188
+ renderAfter;
189
+ @@ -16452,7 +16492,21 @@ class Renderable extends BaseRenderable {
190
+ if (this._lastLayoutFrame === frameId)
191
+ return;
192
+ this._lastLayoutFrame = frameId;
193
+ - const layout = this.yogaNode.getComputedLayout();
194
+ + // Yoga flags each node whose layout it computed, and computes a node's
195
+ + // layout only while computing its parent's. So once its parent was read
196
+ + // in this frame, a node asks for its flag only if the parent was found
197
+ + // flagged since it last asked, and reads its layout only when its own
198
+ + // flag is set; any other node kept its box.
199
+ + const parent = this.parent;
200
+ + if (this._seenLayout === null || !parent || parent._lastLayoutFrame !== frameId || parent._layoutChangedAt > this._layoutCheckedAt) {
201
+ + this._layoutCheckedAt = layoutClock;
202
+ + if (this._seenLayout === null || this.yogaNode.hasNewLayout()) {
203
+ + this._seenLayout = this.yogaNode.getComputedLayout();
204
+ + this.yogaNode.markLayoutSeen();
205
+ + this._layoutChangedAt = this._layoutCheckedAt = ++layoutClock;
206
+ + }
207
+ + }
208
+ + const layout = this._seenLayout;
209
+ const oldX = this._x;
210
+ const oldY = this._y;
211
+ const oldWidth = this._widthValue;
212
+ @@ -17993,8 +18047,12 @@ function isGapType(value) {
213
+ return isValidPercentage(value);
214
+ }
215
+
216
+ +var hoveredFillBoxes = new Set;
217
+ +
171
218
  class BoxRenderable extends Renderable {
172
219
  _backgroundColor;
173
220
  + _hoverBackgroundColor;
@@ -175,7 +222,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
175
222
  _border;
176
223
  _borderStyle;
177
224
  _borderColor;
178
- @@ -18023,6 +18059,7 @@ class BoxRenderable extends Renderable {
225
+ @@ -18023,6 +18081,7 @@ class BoxRenderable extends Renderable {
179
226
  this._focusable = true;
180
227
  }
181
228
  this._backgroundColor = parseColor(options.backgroundColor || this._defaultOptions.backgroundColor);
@@ -183,7 +230,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
183
230
  this._border = options.border ?? this._defaultOptions.border;
184
231
  if (!options.border && (options.borderStyle || options.borderColor || options.focusedBorderColor || options.customBorderChars)) {
185
232
  this._border = true;
186
- @@ -18064,11 +18101,26 @@ class BoxRenderable extends Renderable {
233
+ @@ -18064,11 +18123,26 @@ class BoxRenderable extends Renderable {
187
234
  }
188
235
  set backgroundColor(value) {
189
236
  const newColor = parseColor(value ?? this._defaultOptions.backgroundColor);
@@ -211,27 +258,41 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
211
258
  get border() {
212
259
  return this._border;
213
260
  }
214
- @@ -18152,9 +18204,39 @@ class BoxRenderable extends Renderable {
261
+ @@ -18152,9 +18226,53 @@ class BoxRenderable extends Renderable {
215
262
  this.requestRender();
216
263
  }
217
264
  }
218
265
  + onMouseEvent(event) {
219
266
  + if (!this._hoverBackgroundColor) {
220
267
  + if (this._isHovered) {
221
- + this._isHovered = false;
268
+ + this.setHovered(false);
222
269
  + this.requestRender();
223
270
  + }
224
271
  + return;
225
272
  + }
226
273
  + if (event.type === "over" && !this._isHovered) {
227
- + this._isHovered = true;
274
+ + this.setHovered(true);
228
275
  + this.requestRender();
229
276
  + } else if (event.type === "out" && this._isHovered) {
230
- + this._isHovered = false;
277
+ + this.setHovered(false);
231
278
  + this.requestRender();
232
279
  + }
233
280
  + }
281
+ + setHovered(hovered) {
282
+ + this._isHovered = hovered;
283
+ + if (hovered)
284
+ + hoveredFillBoxes.add(this);
285
+ + else
286
+ + hoveredFillBoxes.delete(this);
287
+ + }
288
+ + destroySelf() {
289
+ + hoveredFillBoxes.delete(this);
290
+ + super.destroySelf();
291
+ + }
234
292
  + getActiveHoverBackgroundColor() {
293
+ + // Every box asks on every frame; with none hovered there is nothing to find.
294
+ + if (hoveredFillBoxes.size === 0)
295
+ + return undefined;
235
296
  + if (this._isHovered && this._hoverBackgroundColor) {
236
297
  + return this._hoverBackgroundColor;
237
298
  + }
@@ -252,7 +313,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
252
313
  if (!hasBorder && !hasVisibleFill) {
253
314
  return;
254
315
  }
255
- @@ -18171,7 +18253,7 @@ class BoxRenderable extends Renderable {
316
+ @@ -18171,7 +18289,7 @@ class BoxRenderable extends Renderable {
256
317
  customBorderChars: this._customBorderChars,
257
318
  border: this._border,
258
319
  borderColor: currentBorderColor,
@@ -261,7 +322,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
261
322
  shouldFill: this.shouldFill,
262
323
  title: this._title,
263
324
  titleAlignment: this._titleAlignment,
264
- @@ -22288,6 +22370,8 @@ class MouseEvent {
325
+ @@ -22288,6 +22406,8 @@ class MouseEvent {
265
326
  button;
266
327
  x;
267
328
  y;
@@ -270,7 +331,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
270
331
  source;
271
332
  modifiers;
272
333
  scroll;
273
- @@ -22307,6 +22391,8 @@ class MouseEvent {
334
+ @@ -22307,6 +22427,8 @@ class MouseEvent {
274
335
  this.button = attributes.button;
275
336
  this.x = attributes.x;
276
337
  this.y = attributes.y;
@@ -279,7 +340,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
279
340
  this.modifiers = attributes.modifiers;
280
341
  this.scroll = attributes.scroll;
281
342
  this.source = attributes.source;
282
- @@ -22457,6 +22543,10 @@ class CliRenderer extends EventEmitter9 {
343
+ @@ -22457,6 +22579,10 @@ class CliRenderer extends EventEmitter9 {
283
344
  resizeDebounceDelay = 100;
284
345
  enableMouseMovement = false;
285
346
  _useMouse = true;
@@ -290,7 +351,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
290
351
  autoFocus = true;
291
352
  _screenMode = "alternate-screen";
292
353
  _footerHeight = DEFAULT_FOOTER_HEIGHT;
293
- @@ -22491,7 +22581,7 @@ class CliRenderer extends EventEmitter9 {
354
+ @@ -22491,7 +22617,7 @@ class CliRenderer extends EventEmitter9 {
294
355
  this.handleResize(width, height);
295
356
  }).bind(this);
296
357
  _capabilities = null;
@@ -299,7 +360,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
299
360
  _hasPointer = false;
300
361
  _lastPointerModifiers = {
301
362
  shift: false,
302
- @@ -22738,7 +22828,13 @@ Captured external output:
363
+ @@ -22738,7 +22864,13 @@ Captured external output:
303
364
  privateCapabilityRepliesActive: false,
304
365
  pixelResolutionQueryActive: false,
305
366
  explicitWidthCprActive: false,
@@ -314,7 +375,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
314
375
  },
315
376
  clock: this.clock
316
377
  });
317
- @@ -24021,12 +24117,14 @@ Captured external output:
378
+ @@ -24021,12 +24153,14 @@ Captured external output:
318
379
  enableMouse() {
319
380
  this._useMouse = true;
320
381
  this.lib.enableMouse(this.rendererPtr, this.enableMouseMovement);
@@ -329,7 +390,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
329
390
  }
330
391
  enableKittyKeyboard(flags = 3) {
331
392
  this.lib.enableKittyKeyboard(this.rendererPtr, flags);
332
- @@ -24036,6 +24134,52 @@ Captured external output:
393
+ @@ -24036,6 +24170,52 @@ Captured external output:
333
394
  this.lib.disableKittyKeyboard(this.rendererPtr);
334
395
  this.updateStdinParserProtocolContext({ kittyKeyboardEnabled: false }, true);
335
396
  }
@@ -382,7 +443,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
382
443
  set useThread(useThread) {
383
444
  this._useThread = useThread;
384
445
  this.lib.setUseThread(this.rendererPtr, useThread);
385
- @@ -24141,6 +24285,7 @@ Captured external output:
446
+ @@ -24141,6 +24321,7 @@ Captured external output:
386
447
  }
387
448
  this.lib.processCapabilityResponse(this.rendererPtr, sequence);
388
449
  this._capabilities = this.lib.getTerminalCapabilities(this.rendererPtr);
@@ -390,7 +451,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
390
451
  if (this._capabilities?.terminal?.from_xtversion) {
391
452
  this.resolveXtVersionWaiters();
392
453
  }
393
- @@ -24170,6 +24315,7 @@ Captured external output:
454
+ @@ -24170,6 +24351,7 @@ Captured external output:
394
455
  if (sequence === "\x1B[I") {
395
456
  if (this.shouldRestoreModesOnNextFocus) {
396
457
  this.lib.restoreTerminalModes(this.rendererPtr);
@@ -398,7 +459,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
398
459
  this.shouldRestoreModesOnNextFocus = false;
399
460
  }
400
461
  if (this._terminalFocusState !== true) {
401
- @@ -24218,7 +24364,7 @@ Captured external output:
462
+ @@ -24218,7 +24400,7 @@ Captured external output:
402
463
  this._keyHandler.processParsedKey(event.key);
403
464
  return;
404
465
  case "mouse":
@@ -407,7 +468,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
407
468
  return;
408
469
  }
409
470
  this.dispatchSequenceHandlers(event.raw);
410
- @@ -24264,6 +24410,7 @@ Captured external output:
471
+ @@ -24264,6 +24446,7 @@ Captured external output:
411
472
  }
412
473
  this.waitingForPixelResolution = false;
413
474
  this.updateStdinParserProtocolContext({ pixelResolutionQueryActive: false }, true);
@@ -415,7 +476,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
415
476
  return true;
416
477
  }
417
478
  return false;
418
- @@ -24292,15 +24439,62 @@ Captured external output:
479
+ @@ -24292,15 +24475,62 @@ Captured external output:
419
480
  }
420
481
  return event;
421
482
  }
@@ -478,7 +539,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
478
539
  this._hasPointer = true;
479
540
  this._lastPointerModifiers = mouseEvent.modifiers;
480
541
  if (this._console.visible) {
481
- @@ -24437,6 +24631,8 @@ Captured external output:
542
+ @@ -24437,6 +24667,8 @@ Captured external output:
482
543
  return;
483
544
  }
484
545
  const baseEvent = {
@@ -487,7 +548,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
487
548
  type: "move",
488
549
  button: 0,
489
550
  x: this._latestPointer.x,
490
- @@ -24527,6 +24723,7 @@ Captured external output:
551
+ @@ -24527,6 +24759,7 @@ Captured external output:
491
552
  const pendingSplitFooterTransition = this.pendingSplitFooterTransition;
492
553
  const previousGeometry = calculateRenderGeometry(this._screenMode, this._terminalWidth, this._terminalHeight, this._footerHeight);
493
554
  const prevWidth = this._terminalWidth;
@@ -495,7 +556,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
495
556
  const previousTerminalHeight = this._terminalHeight;
496
557
  const visiblePreviousSplitHeight = pendingSplitFooterTransition?.sourceHeight ?? previousGeometry.effectiveFooterHeight;
497
558
  this._terminalWidth = width;
498
- @@ -24832,6 +25029,11 @@ Captured external output:
559
+ @@ -24832,6 +25065,11 @@ Captured external output:
499
560
  this.clock.clearTimeout(this.resizeTimeoutId);
500
561
  this.resizeTimeoutId = null;
501
562
  }
@@ -507,7 +568,7 @@ index b9445d2cca9477dfe06026da451b6d19268fcbdd..8734376ebd706056791f8b59ad0992ac
507
568
  if (this.capabilityTimeoutId !== null) {
508
569
  this.clock.clearTimeout(this.capabilityTimeoutId);
509
570
  this.capabilityTimeoutId = null;
510
- @@ -24847,6 +25049,7 @@ Captured external output:
571
+ @@ -24847,6 +25085,7 @@ Captured external output:
511
572
  }
512
573
  this.themeModeState.cancelRefresh();
513
574
  this._isRunning = false;
@@ -32,6 +32,27 @@ export const QUALITY_FIELDS = [
32
32
  "revenueCagr3YPercent", "revenueCagr5YPercent", "epsCagr3YPercent", "epsCagr5YPercent",
33
33
  "forwardRevenueGrowthPercent", "forwardEpsGrowthPercent",
34
34
  ] as const;
35
+ /**
36
+ * Classic scores: Piotroski F, Altman Z, the Graham number and Lynch fair value with their upside, Greenblatt's
37
+ * earnings yield, return on capital and Magic Formula rank, the 1Y total return and its RS rating, years of profit,
38
+ * revenue growth and dividend growth, and S&P 500 and Dow membership; listed only when asked (`include=scores`), and
39
+ * omitted by a server from before them.
40
+ */
41
+ export const SCORE_FIELDS = [
42
+ "piotroskiFScore", "altmanZScore", "grahamNumber", "grahamUpsidePercent", "lynchFairValue", "lynchUpsidePercent",
43
+ "earningsYieldPercent", "returnOnCapitalPercent", "magicFormulaRank", "totalReturn1YPercent", "rsRating",
44
+ "profitableYears", "revenueGrowthYears", "dividendGrowthYears", "sp500Member", "dowMember",
45
+ ] as const;
46
+ /** Index membership, 1 for a member and 0 for a US listing that is not one. */
47
+ export const MEMBERSHIP_FIELDS = ["sp500Member", "dowMember"] as const;
48
+ /** The factor grades, each ranked within the company's sector: 1 is F and 13 is A+. */
49
+ export const LETTER_GRADE_FIELDS = ["valueGrade", "growthGrade", "profitabilityGrade", "momentumGrade", "revisionsGrade"] as const;
50
+ /**
51
+ * The factor grades, their 1-5 composite, and the next fiscal year's EPS and the current year's revenue revisions the
52
+ * Revisions grade reads beside EPS revision 30D; listed only when asked (`include=grades`), and omitted by a server
53
+ * from before them.
54
+ */
55
+ export const GRADE_FIELDS = [...LETTER_GRADE_FIELDS, "gradeComposite", "nextYearEpsRevision30dPercent", "revenueRevision30dPercent"] as const;
35
56
  export const NUMERIC_FIELDS = [
36
57
  ...KPI_FIELDS,
37
58
  "price",
@@ -83,6 +104,8 @@ export const NUMERIC_FIELDS = [
83
104
  ...OPTION_VOLATILITY_FIELDS,
84
105
  ...OWNERSHIP_FIELDS,
85
106
  ...QUALITY_FIELDS,
107
+ ...SCORE_FIELDS,
108
+ ...GRADE_FIELDS,
86
109
  "hiringOpenRoles", "hiringNetAddsWeek", "hiringRemotePercent", "hiringZScore",
87
110
  "appAttentionScore", "appRankVelocity7d", "appRatingDrift7d", "appRatingCountGrowth7d",
88
111
  ] as const;
@@ -14,6 +14,7 @@ import { PluginOffError, notifyPluginOff } from "../../plugins/plugin-off";
14
14
  import type { LoadedExternalPlugin } from "../../plugins/loader";
15
15
  import {
16
16
  getFocusedCollectionId,
17
+ linkedSourceIds,
17
18
  resolveTickerForPane,
18
19
  syncConfigActiveLayoutState,
19
20
  type AppAction,
@@ -89,6 +90,7 @@ export function useAppPaneRuntime({
89
90
  const normalizedLayout = normalizePaneLayout(layout, {
90
91
  resolveOrphanSymbol: (instanceId) => resolveTickerForPane(currentState, instanceId),
91
92
  pinOrphan: pinFollowingPane,
93
+ externalSourceIds: linkedSourceIds(currentState),
92
94
  });
93
95
  if (options?.pushHistory !== false) {
94
96
  dispatch({ type: "PUSH_LAYOUT_HISTORY" });
@@ -51,7 +51,9 @@ import type {
51
51
  LayoutConfig,
52
52
  PaneInstanceConfig,
53
53
  } from "../../types/config";
54
- import { findPaneInstance, TICKER_RESEARCH_PANE_ID } from "../../types/config";
54
+ import { findPaneInstance, normalizePaneId, TICKER_RESEARCH_PANE_ID } from "../../types/config";
55
+ import { getDesktopWindows } from "../../state/desktop-windows";
56
+ import { fireAndForget } from "../../utils/fire-and-forget";
55
57
  import type { DataProvider } from "../../types/data-provider";
56
58
  import type {
57
59
  PaneDef,
@@ -278,6 +280,13 @@ export function bindAppPanePluginRegistry({
278
280
  }
279
281
  const instanceId = resolvePaneTarget(paneId);
280
282
  if (!instanceId || !isPaneInLayout(stateRef.current.config.layout, instanceId)) {
283
+ // A pane id that is no pane type may be a pane in another desktop
284
+ // window, as a link's source is: that window brings it forward.
285
+ const windows = getDesktopWindows();
286
+ if (windows && windows.list().length > 1 && !pluginRegistry.panes.has(normalizePaneId(paneId))) {
287
+ fireAndForget(windows.focusPane(paneId), "desktop.focusPane");
288
+ return;
289
+ }
281
290
  showPane(paneId);
282
291
  return;
283
292
  }
package/src/app.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Box, ContextMenuProvider, useNativeRenderer, useRendererHost, useUiHost } from "./ui";
2
2
  import { ToastViewport, useToastHost } from "./ui/toast";
3
- import { useState, useEffect, useCallback, useRef, useMemo, type ReactNode } from "react";
3
+ import { useState, useEffect, useCallback, useRef, useMemo, useSyncExternalStore, type Dispatch, type ReactNode } from "react";
4
4
  import {
5
5
  AppProvider,
6
6
  getFocusedTickerSymbol,
@@ -9,6 +9,7 @@ import {
9
9
  useAppStateRef,
10
10
  type AppState,
11
11
  } from "./state/app/context";
12
+ import type { AppAction } from "./core/state/app/state";
12
13
  import { bindAppActivity, useAppActive, useAppVisible } from "./state/app/activity";
13
14
  import { Header } from "./components/layout/header";
14
15
  import { StatusBar } from "./components/layout/status-bar";
@@ -35,7 +36,7 @@ import type { AppNotificationRequest, CliLaunchRequest, GloomPlugin } from "./ty
35
36
  import type { DataProvider } from "./types/data-provider";
36
37
  import type { DesktopDockPreviewState, DesktopSharedStateSnapshot, DesktopThemePreviewState, DesktopWindowBridge } from "./types/desktop-window";
37
38
  import type { DesktopApplicationMenuBridge } from "./types/desktop-menu";
38
- import type { LayoutBounds } from "./layout/pane-manager";
39
+ import { isPaneInLayout, type LayoutBounds } from "./layout/pane-manager";
39
40
  import type { AppSessionSnapshot } from "./core/state/session-persistence";
40
41
  import type { MarketDataCoordinator } from "./market-data/coordinator";
41
42
  import { createAppNotifier } from "./notifications/app-notifier";
@@ -54,6 +55,9 @@ import { useAppUpdateRuntime } from "./app/runtime/update";
54
55
  import { resolveUpdateChannel } from "./updater/channel";
55
56
  import { createCoreSyncContributors } from "./sync/core-contributors";
56
57
  import { useCloudSyncRuntime } from "./sync/react";
58
+ import { changesOtherWindowTabs, withOtherWindowTabs, withoutOtherWindowTabs } from "./sync/other-window-tabs";
59
+ import { getDesktopWindows } from "./state/desktop-windows";
60
+ import type { OtherWindowTab } from "./types/desktop-window";
57
61
  import { RemoteControlHost, type RemoteControlAdapter } from "./remote/app-host";
58
62
  import { RemoteUiRegistryProvider } from "./remote/semantic-tree";
59
63
  import {
@@ -61,7 +65,7 @@ import {
61
65
  resolveCliLaunchConfig,
62
66
  resolveInitialAppConfig,
63
67
  } from "./app/app-bootstrap-state";
64
- import { scheduleConfigSave } from "./state/config-save-scheduler";
68
+ import { saveConfigImmediately, scheduleConfigSave } from "./state/config-save-scheduler";
65
69
  import { LOW_PRIORITY_CONFIG_SAVE_DEBOUNCE_MS } from "./state/persist-scheduler";
66
70
  import { savedLayoutsDifferOnlyInMirror } from "./core/state/app/layout";
67
71
  import { measurePerf } from "./utils/perf-marks";
@@ -117,6 +121,10 @@ function ThemedAppRoot({ children }: { children: ReactNode }) {
117
121
  );
118
122
  }
119
123
 
124
+ const noOtherWindowTabs = (): readonly OtherWindowTab[] => NO_OTHER_WINDOW_TABS;
125
+ const NO_OTHER_WINDOW_TABS: readonly OtherWindowTab[] = [];
126
+ const noSubscription = () => () => {};
127
+
120
128
  function AppInner({
121
129
  externalPlugins,
122
130
  pluginRegistry,
@@ -184,6 +192,27 @@ function AppInner({
184
192
  updateCheckInProgress,
185
193
  updateProgress,
186
194
  ]);
195
+ // Cloud sync in the desktop app's main window pushes and pulls every
196
+ // window's tabs, not only its own (sync/other-window-tabs.ts). The same
197
+ // state, getter and dispatch with one window and everywhere else.
198
+ const desktopWindows = getDesktopWindows();
199
+ const otherWindowTabs = useSyncExternalStore(
200
+ desktopWindows?.subscribe ?? noSubscription,
201
+ desktopWindows?.otherWindowTabs ?? noOtherWindowTabs,
202
+ );
203
+ const otherWindowTabsRef = useRef(otherWindowTabs);
204
+ otherWindowTabsRef.current = otherWindowTabs;
205
+ const syncState = useMemo(() => withOtherWindowTabs(state, otherWindowTabs), [state, otherWindowTabs]);
206
+ const getSyncState = useCallback(() => withOtherWindowTabs(stateRef.current, otherWindowTabsRef.current), [stateRef]);
207
+ const syncDispatch = useCallback<Dispatch<AppAction>>((action) => {
208
+ if (action.type !== "SET_CONFIG") {
209
+ dispatch(action);
210
+ return;
211
+ }
212
+ const others = otherWindowTabsRef.current;
213
+ if (changesOtherWindowTabs(action.config, others)) void saveConfigImmediately(action.config);
214
+ dispatch({ ...action, config: withoutOtherWindowTabs(action.config, others, stateRef.current.config) });
215
+ }, [dispatch, stateRef]);
187
216
  const appActive = useAppActive();
188
217
  const appVisible = useAppVisible();
189
218
  const appActiveRef = useRef(appActive);
@@ -191,6 +220,10 @@ function AppInner({
191
220
  const dialog = useDialog();
192
221
  const toast = useToastHost();
193
222
  const isDetachedWindow = desktopWindowBridge?.kind === "detached";
223
+ // The main desktop window does the app-wide work (account sync, update
224
+ // checks, launch notices, background alerts); a popped-out pane's window
225
+ // and every other full window leave it to it.
226
+ const appWideWorkElsewhere = isDetachedWindow || desktopWindowBridge?.primary === false;
194
227
  // Not while setup is already showing.
195
228
  const runSetupAgain = useRunSetupAgain(onboardingActive ? undefined : onRunSetupAgain);
196
229
  const detachedPaneId = isDetachedWindow ? desktopWindowBridge.paneId ?? null : null;
@@ -245,11 +278,21 @@ function AppInner({
245
278
  }, [pluginRegistry]);
246
279
 
247
280
  useEffect(() => {
248
- if (desktopWindowBridge?.kind !== "main" || !desktopWindowBridge.subscribeDockPreview) return;
281
+ // Popped-out panes dock into the main window only.
282
+ if (desktopWindowBridge?.kind !== "main" || appWideWorkElsewhere || !desktopWindowBridge.subscribeDockPreview) return;
249
283
  return desktopWindowBridge.subscribeDockPreview((preview) => {
250
284
  setDesktopDockPreview(preview);
251
285
  });
252
- }, [desktopWindowBridge]);
286
+ }, [appWideWorkElsewhere, desktopWindowBridge]);
287
+
288
+ // Another window asked this one to show one of its panes: a link followed, a pane found.
289
+ useEffect(() => {
290
+ const windows = desktopWindowBridge?.kind === "main" ? desktopWindowBridge.windows : undefined;
291
+ if (!windows) return;
292
+ return windows.subscribeFocusRequests((paneId) => {
293
+ if (isPaneInLayout(stateRef.current.config.layout, paneId)) pluginRegistry.focusPane(paneId);
294
+ });
295
+ }, [desktopWindowBridge, pluginRegistry, stateRef]);
253
296
 
254
297
  useEffect(() => {
255
298
  const disposers = createCoreSyncContributors().map((contributor) => (
@@ -286,7 +329,7 @@ function AppInner({
286
329
  const { restartToApplyUpdate, runUpdateCheck, runUpdateCommand, startUpdate } = useAppUpdateRuntime({
287
330
  enabled: updatesEnabled,
288
331
  dispatch,
289
- isDetachedWindow,
332
+ isDetachedWindow: appWideWorkElsewhere,
290
333
  pluginRegistry,
291
334
  stateRef,
292
335
  updateAvailable: state.updateAvailable,
@@ -326,7 +369,7 @@ function AppInner({
326
369
  externalPlugins,
327
370
  focusedTickerSymbol,
328
371
  getState: getRemoteState,
329
- isDetachedWindow,
372
+ isDetachedWindow: appWideWorkElsewhere,
330
373
  marketData,
331
374
  pluginRegistry,
332
375
  pluginsReady,
@@ -351,16 +394,16 @@ function AppInner({
351
394
  });
352
395
 
353
396
  useCloudSyncRuntime({
354
- state,
355
- getState: getRemoteState,
356
- dispatch,
397
+ state: syncState,
398
+ getState: getSyncState,
399
+ dispatch: syncDispatch,
357
400
  tickerRepository,
358
401
  pluginRegistry,
359
402
  appActive,
360
403
  // Keep a first-run workspace stable while the local guide is active. Once
361
404
  // onboarding finishes, the normal pull-before-push sync starts immediately.
362
405
  initialized: state.initialized
363
- && desktopWindowBridge?.kind !== "detached"
406
+ && !appWideWorkElsewhere
364
407
  && !onboardingActive
365
408
  && !signInGateActive,
366
409
  });
@@ -388,11 +431,11 @@ function AppInner({
388
431
 
389
432
  // Wire up app-level notifications.
390
433
  pluginRegistry.bindHost({ notify: appNotifier.notify });
391
- // Missed alerts live in this device's state store. A detached window keeps
392
- // its own in memory rather than overwrite the main window's.
434
+ // Missed alerts live in this device's state store. Any other desktop window
435
+ // keeps its own in memory rather than overwrite the main window's.
393
436
  useEffect(() => (
394
- isDetachedWindow ? undefined : attachNotificationLog(pluginRegistry.persistence.pluginState)
395
- ), [isDetachedWindow, pluginRegistry]);
437
+ appWideWorkElsewhere ? undefined : attachNotificationLog(pluginRegistry.persistence.pluginState)
438
+ ), [appWideWorkElsewhere, pluginRegistry]);
396
439
 
397
440
  // Persist layout changes (switching, saving, deleting, renaming layouts).
398
441
  // The saved layouts also mirror live pane state and focus, so they change on
@@ -607,8 +650,10 @@ export function App({
607
650
  }, [requireSignIn]);
608
651
  const signInGateActive = requireSignIn && !signedIn;
609
652
  const shareHandoff = isPaneShareHandoff();
653
+ // Setup runs in the main window only.
610
654
  const [showOnboarding, setShowOnboarding] = useState(() => (
611
655
  desktopWindowBridge?.kind !== "detached"
656
+ && desktopWindowBridge?.primary !== false
612
657
  && !shareHandoff
613
658
  && (!effectiveInitialConfig.onboardingComplete || !!effectiveInitialConfig.onboardingProgress)
614
659
  ));
@@ -650,7 +695,9 @@ export function App({
650
695
  <RemoteUiRegistryProvider>
651
696
  <AppProvider
652
697
  config={config}
653
- sessionStore={desktopWindowBridge?.kind === "detached" ? undefined : services.persistence.sessions}
698
+ sessionStore={desktopWindowBridge?.kind === "detached" || desktopWindowBridge?.primary === false
699
+ ? undefined
700
+ : services.persistence.sessions}
654
701
  sessionSnapshot={sessionSnapshot}
655
702
  desktopBridge={desktopWindowBridge}
656
703
  desktopSnapshot={desktopSnapshot}
@@ -1,4 +1,5 @@
1
1
  import type { CliCommandContext } from "../../types/plugin";
2
+ import { currencyNameStop } from "../currency-name-hint";
2
3
 
3
4
  export function takeOption(args: string[], name: string): string | undefined {
4
5
  const equalsPrefix = `${name}=`;
@@ -71,6 +72,9 @@ export function requireOneArg(
71
72
  ctx: CliCommandContext,
72
73
  ): string {
73
74
  const value = requireArg(args[0], `Usage: gloom ${usage}`, ctx);
75
+ // A currency's name in words (`ticker swiss franc`) is its pair, not two symbols.
76
+ const currency = noun === "symbol" && args.length > 1 ? currencyNameStop(args, usage.split(" ")[0]!) : null;
77
+ if (currency) ctx.fail(currency.message, currency.details);
74
78
  rejectExtraArgs(args, 1, { usage, takes: `one ${noun}`, advice: `Run it once per ${noun}.` }, ctx);
75
79
  return value;
76
80
  }