@gloom-sh/terminal 0.20.3 → 0.20.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 (348) hide show
  1. package/README.md +2 -0
  2. package/bin/gloom +9 -0
  3. package/bin/without-bun.cjs +98 -0
  4. package/package.json +3 -1
  5. package/src/account/auth-dialog.tsx +17 -0
  6. package/src/api-client/data.ts +144 -35
  7. package/src/api-client/fx-interventions.ts +64 -0
  8. package/src/api-client/index.ts +1 -0
  9. package/src/api-client/release-summaries.ts +21 -0
  10. package/src/api-client/types/econ.ts +12 -0
  11. package/src/api-client/yield-curves.ts +1 -1
  12. package/src/app/global-shortcuts.ts +4 -1
  13. package/src/app/keybindings/actions.ts +8 -2
  14. package/src/app/keybindings/config.ts +2 -1
  15. package/src/app/keybindings/index.ts +1 -0
  16. package/src/app/keybindings/labels.ts +6 -1
  17. package/src/app/keybindings/resolve.ts +23 -4
  18. package/src/app/keybindings/terminal-keys.ts +35 -0
  19. package/src/app/pane-runtime/index.tsx +2 -2
  20. package/src/app/pane-runtime/ticker-open-runtime.ts +274 -67
  21. package/src/architecture/ui-literals-allowlist.json +1 -1
  22. package/src/capabilities/chart-series.ts +27 -1
  23. package/src/cli/commands/keybindings.ts +5 -5
  24. package/src/cli/commands/market.ts +154 -21
  25. package/src/cli/commands/news-search.ts +60 -10
  26. package/src/cli/commands/overview.ts +16 -1
  27. package/src/cli/commands/plugins.ts +27 -5
  28. package/src/cli/commands/remote.ts +16 -17
  29. package/src/cli/commands/system.ts +20 -4
  30. package/src/cli/commands/ticker.ts +60 -19
  31. package/src/cli/fx-forward.ts +25 -7
  32. package/src/cli/glossary.ts +19 -5
  33. package/src/cli/history-rows.ts +5 -3
  34. package/src/cli/index.ts +8 -8
  35. package/src/cli/known-gaps.ts +27 -1
  36. package/src/cli/listing-arg.ts +11 -1
  37. package/src/cli/name-entries.ts +5 -1
  38. package/src/cli/not-a-ticker.ts +4 -0
  39. package/src/cli/pane-functions/function-help.ts +5 -5
  40. package/src/cli/report-tables.ts +18 -6
  41. package/src/cli/result.ts +15 -7
  42. package/src/cli/types.ts +2 -0
  43. package/src/components/chart/composite/axis-overlays.tsx +22 -0
  44. package/src/components/chart/composite/composite-chart.tsx +54 -13
  45. package/src/components/chart/composite/event-captions.ts +109 -0
  46. package/src/components/chart/composite/event-guides.ts +74 -0
  47. package/src/components/chart/composite/rasterizer.ts +2 -0
  48. package/src/components/chart/composite/text-renderer.ts +2 -0
  49. package/src/components/chart/composite/types.ts +31 -0
  50. package/src/components/command-bar/layout-items/focused-pane.ts +5 -5
  51. package/src/components/command-bar/pane-settings.ts +2 -2
  52. package/src/components/command-bar/routes/root/provider-search.ts +5 -4
  53. package/src/components/command-bar/routes/root/results.ts +6 -2
  54. package/src/components/command-bar/routes/ticker-search/results.ts +51 -0
  55. package/src/components/command-bar/routes/ticker-search/route.ts +3 -2
  56. package/src/components/input-search-bar.tsx +9 -2
  57. package/src/components/layout/detached-pane-shell.tsx +1 -1
  58. package/src/components/layout/floating-pane.tsx +5 -1
  59. package/src/components/layout/pane/footer/index.tsx +21 -14
  60. package/src/components/layout/pane/footer/model.ts +6 -0
  61. package/src/components/layout/pane/header.tsx +2 -0
  62. package/src/components/layout/shell/action-menu-overlay.tsx +10 -5
  63. package/src/components/layout/shell/active-drag.ts +149 -105
  64. package/src/components/layout/shell/drag/drop-zones.ts +162 -0
  65. package/src/components/layout/shell/drag/index.ts +47 -218
  66. package/src/components/layout/shell/drag/live.ts +10 -3
  67. package/src/components/layout/shell/drag/overlays.tsx +182 -5
  68. package/src/components/layout/shell/drag/runtime.ts +29 -6
  69. package/src/components/layout/shell/drag/shared-edges.ts +156 -0
  70. package/src/components/layout/shell/index.tsx +11 -6
  71. package/src/components/layout/shell/menu.ts +11 -2
  72. package/src/components/layout/shell/native/pointer-runtime.ts +25 -0
  73. package/src/components/layout/shell/native/window-state.ts +2 -2
  74. package/src/components/layout/shell/pane/capture.ts +4 -1
  75. package/src/components/layout/shell/pane/layers.tsx +71 -7
  76. package/src/components/layout/shell/terminal-pointer-runtime.ts +18 -9
  77. package/src/components/layout/shell/window-mode/index.ts +8 -10
  78. package/src/components/layout/status-bar.tsx +6 -1
  79. package/src/components/layout/window-edit/mode.ts +39 -7
  80. package/src/components/layout/window-edit/presentation.ts +1 -1
  81. package/src/components/onboarding/first-run-workspace.ts +44 -2
  82. package/src/components/onboarding/onboarding-frame.tsx +11 -2
  83. package/src/components/onboarding/onboarding-keyboard.ts +20 -0
  84. package/src/components/onboarding/onboarding-wizard.tsx +16 -11
  85. package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
  86. package/src/components/onboarding/use-onboarding-progress.ts +12 -4
  87. package/src/components/pane-settings-dialog/desktop.tsx +2 -2
  88. package/src/components/pane-settings-dialog/tui.tsx +2 -2
  89. package/src/components/pane-settings-dialog/value.ts +6 -0
  90. package/src/components/pane-settings-dialog.tsx +3 -3
  91. package/src/components/reader/detail-reader.tsx +4 -0
  92. package/src/components/ui/button.tsx +2 -0
  93. package/src/components/ui/choice-dialog.tsx +1 -0
  94. package/src/components/ui/data-table/index.tsx +4 -3
  95. package/src/components/ui/index.ts +1 -1
  96. package/src/components/ui/list-view.tsx +7 -12
  97. package/src/components/ui/loading.tsx +10 -3
  98. package/src/components/ui/menu.tsx +6 -2
  99. package/src/components/ui/page-stack-view.tsx +3 -0
  100. package/src/components/ui/pane-link-chip.tsx +269 -54
  101. package/src/components/ui/query-bar.tsx +2 -1
  102. package/src/components/ui/quote.ts +14 -1
  103. package/src/components/ui/tabs.tsx +97 -19
  104. package/src/core/state/app/layout-reducer.ts +7 -0
  105. package/src/core/state/app/layout.ts +44 -7
  106. package/src/core/state/app/state.ts +1 -1
  107. package/src/core/state/app/types.ts +22 -2
  108. package/src/data/config/layout.ts +5 -2
  109. package/src/docs/snapshot.json +54 -13
  110. package/src/i18n/es.ts +9 -8
  111. package/src/i18n/ja.ts +9 -8
  112. package/src/i18n/ko.ts +9 -8
  113. package/src/i18n/zh-cn.ts +9 -8
  114. package/src/i18n/zh-tw.ts +9 -8
  115. package/src/layout/pane-manager/floating-actions.ts +17 -0
  116. package/src/layout/pane-manager/floating-stack.ts +187 -0
  117. package/src/layout/pane-manager/floating.ts +4 -2
  118. package/src/layout/pane-manager/gridlock.ts +5 -1
  119. package/src/layout/pane-manager/index.ts +11 -0
  120. package/src/layout/pane-manager/layout-state.ts +10 -3
  121. package/src/market-data/depositary-pair.ts +5 -3
  122. package/src/market-data/futures-board.ts +46 -1
  123. package/src/market-data/futures-contract.ts +12 -3
  124. package/src/market-data/fx-interventions.ts +270 -0
  125. package/src/market-data/market/dated-previous-close.ts +94 -15
  126. package/src/market-data/market/status.ts +17 -1
  127. package/src/news/news-model.ts +44 -2
  128. package/src/plugins/builtin/alerts/cli.ts +4 -4
  129. package/src/plugins/builtin/alerts/format.ts +1 -2
  130. package/src/plugins/builtin/alerts/headless.ts +1 -2
  131. package/src/plugins/builtin/alerts/move-checks.ts +12 -6
  132. package/src/plugins/builtin/alerts/move.ts +30 -9
  133. package/src/plugins/builtin/alerts/pane.tsx +0 -2
  134. package/src/plugins/builtin/alerts/storage.ts +4 -2
  135. package/src/plugins/builtin/alerts/types.ts +12 -0
  136. package/src/plugins/builtin/analytics/risk-client.ts +10 -4
  137. package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
  138. package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
  139. package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
  140. package/src/plugins/builtin/awards/index.tsx +1 -1
  141. package/src/plugins/builtin/buildout/index.tsx +1 -0
  142. package/src/plugins/builtin/catalysts/index.tsx +2 -2
  143. package/src/plugins/builtin/cds/headless.ts +4 -0
  144. package/src/plugins/builtin/changelog/index.tsx +292 -101
  145. package/src/plugins/builtin/changelog/versions.ts +293 -0
  146. package/src/plugins/builtin/chart-composer/headless.ts +2 -1
  147. package/src/plugins/builtin/chart-composer/index.tsx +1 -0
  148. package/src/plugins/builtin/chart-composer/intervention-events.ts +105 -0
  149. package/src/plugins/builtin/chart-composer/pane.tsx +21 -7
  150. package/src/plugins/builtin/chat/content/composer.tsx +5 -4
  151. package/src/plugins/builtin/chat/content/index.tsx +12 -2
  152. package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
  153. package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
  154. package/src/plugins/builtin/chat/layout.ts +5 -2
  155. package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
  156. package/src/plugins/builtin/chat/message/render-state.ts +2 -5
  157. package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
  158. package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
  159. package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
  160. package/src/plugins/builtin/cloud/askg/attached-pane.tsx +10 -5
  161. package/src/plugins/builtin/cloud/askg/controller.ts +141 -5
  162. package/src/plugins/builtin/cloud/askg/executor.ts +113 -4
  163. package/src/plugins/builtin/cloud/askg/manifest.ts +28 -13
  164. package/src/plugins/builtin/cloud/askg/model.ts +14 -4
  165. package/src/plugins/builtin/cloud/askg/pane.tsx +70 -46
  166. package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
  167. package/src/plugins/builtin/cloud/askg/turn-parts.tsx +70 -0
  168. package/src/plugins/builtin/cloud/terminal-relay/engine.ts +50 -130
  169. package/src/plugins/builtin/cloud/terminal-relay/policy.ts +327 -7
  170. package/src/plugins/builtin/cloud/terminal-relay/prompts.tsx +2 -1
  171. package/src/plugins/builtin/cloud/terminal-relay/redact.ts +52 -9
  172. package/src/plugins/builtin/commodities-energy/index.tsx +1 -3
  173. package/src/plugins/builtin/commodities-energy/view-state.ts +3 -0
  174. package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
  175. package/src/plugins/builtin/company-attention/index.tsx +1 -1
  176. package/src/plugins/builtin/company-kpis/headless.ts +3 -1
  177. package/src/plugins/builtin/company-kpis/index.tsx +2 -2
  178. package/src/plugins/builtin/cot/headless.ts +14 -2
  179. package/src/plugins/builtin/cot/index.tsx +1 -1
  180. package/src/plugins/builtin/cpi/index.tsx +1 -1
  181. package/src/plugins/builtin/crypto-board/index.tsx +1 -0
  182. package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
  183. package/src/plugins/builtin/doe/index.tsx +1 -1
  184. package/src/plugins/builtin/earnings/index.tsx +2 -2
  185. package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
  186. package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
  187. package/src/plugins/builtin/econ/calendar-model.ts +74 -1
  188. package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
  189. package/src/plugins/builtin/econ/index.tsx +1 -0
  190. package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
  191. package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
  192. package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
  193. package/src/plugins/builtin/executives/index.tsx +1 -0
  194. package/src/plugins/builtin/filing-events/index.tsx +1 -0
  195. package/src/plugins/builtin/fixed-income/index.tsx +1 -0
  196. package/src/plugins/builtin/futures/index.tsx +25 -4
  197. package/src/plugins/builtin/futures/model.ts +28 -32
  198. package/src/plugins/builtin/futures/series.ts +4 -3
  199. package/src/plugins/builtin/futures/table.tsx +16 -9
  200. package/src/plugins/builtin/futures/use-board-terms.ts +3 -3
  201. package/src/plugins/builtin/futures-curve/headless.ts +3 -3
  202. package/src/plugins/builtin/futures-curve/index.tsx +1 -1
  203. package/src/plugins/builtin/futures-curve/model.ts +18 -0
  204. package/src/plugins/builtin/gpu/index.tsx +1 -1
  205. package/src/plugins/builtin/help/functions-table.tsx +1 -1
  206. package/src/plugins/builtin/help/index.tsx +14 -4
  207. package/src/plugins/builtin/help/keybindings-editor.tsx +19 -5
  208. package/src/plugins/builtin/holders/index.tsx +1 -0
  209. package/src/plugins/builtin/holders/report-header.ts +2 -2
  210. package/src/plugins/builtin/insider/index.tsx +1 -0
  211. package/src/plugins/builtin/iv-history/index.tsx +1 -1
  212. package/src/plugins/builtin/jobs/index.tsx +1 -0
  213. package/src/plugins/builtin/layout-manager/index.tsx +8 -8
  214. package/src/plugins/builtin/macro-day/headless.ts +27 -8
  215. package/src/plugins/builtin/macro-day/index.tsx +1 -1
  216. package/src/plugins/builtin/macro-day/model.ts +19 -3
  217. package/src/plugins/builtin/macro-day/pane.tsx +14 -9
  218. package/src/plugins/builtin/macro-day/releases.ts +25 -7
  219. package/src/plugins/builtin/market-valuation/index.tsx +1 -0
  220. package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
  221. package/src/plugins/builtin/members/index.tsx +1 -1
  222. package/src/plugins/builtin/mna/index.tsx +1 -0
  223. package/src/plugins/builtin/news/headless.ts +2 -2
  224. package/src/plugins/builtin/news/index.tsx +4 -3
  225. package/src/plugins/builtin/news/wire/index.tsx +5 -1
  226. package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
  227. package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
  228. package/src/plugins/builtin/options/index.tsx +1 -0
  229. package/src/plugins/builtin/options-positioning/index.tsx +1 -0
  230. package/src/plugins/builtin/pe-band/index.tsx +1 -1
  231. package/src/plugins/builtin/perps/markets-section.tsx +5 -2
  232. package/src/plugins/builtin/plugin-marketplace/pane.tsx +11 -11
  233. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
  234. package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
  235. package/src/plugins/builtin/portfolio-list/summary/index.tsx +3 -1
  236. package/src/plugins/builtin/power/index.tsx +1 -1
  237. package/src/plugins/builtin/realized-vol/index.tsx +1 -1
  238. package/src/plugins/builtin/research/event-model.ts +9 -1
  239. package/src/plugins/builtin/research/event-sources.ts +22 -0
  240. package/src/plugins/builtin/research/headless.ts +11 -5
  241. package/src/plugins/builtin/research/index.tsx +4 -0
  242. package/src/plugins/builtin/research-search/index.tsx +1 -0
  243. package/src/plugins/builtin/research-search/pane.tsx +8 -0
  244. package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
  245. package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
  246. package/src/plugins/builtin/risk-factors/index.tsx +1 -0
  247. package/src/plugins/builtin/scanner/headless.ts +52 -13
  248. package/src/plugins/builtin/seasonality/index.tsx +1 -1
  249. package/src/plugins/builtin/sec/index.tsx +1 -0
  250. package/src/plugins/builtin/series-inventory.ts +1 -1
  251. package/src/plugins/builtin/shared/cloud-upgrade.ts +27 -3
  252. package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
  253. package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
  254. package/src/plugins/builtin/short-interest/index.tsx +1 -0
  255. package/src/plugins/builtin/social-mentions/index.tsx +1 -1
  256. package/src/plugins/builtin/supply-chain/index.tsx +1 -0
  257. package/src/plugins/builtin/thirteenf/data.ts +43 -10
  258. package/src/plugins/builtin/thirteenf/headless.ts +55 -11
  259. package/src/plugins/builtin/thirteenf/model.ts +25 -9
  260. package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
  261. package/src/plugins/builtin/thirteenf/types.ts +2 -0
  262. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
  263. package/src/plugins/builtin/ticker-detail/financials/model.ts +12 -0
  264. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
  265. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +5 -5
  266. package/src/plugins/builtin/ticker-detail/headless.ts +18 -13
  267. package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
  268. package/src/plugins/builtin/ticker-detail/overview/components.tsx +54 -5
  269. package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
  270. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +34 -17
  271. package/src/plugins/builtin/ticker-detail/pane.tsx +7 -2
  272. package/src/plugins/builtin/time-sales/client.ts +9 -11
  273. package/src/plugins/builtin/time-sales/index.tsx +1 -1
  274. package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
  275. package/src/plugins/builtin/treasury-auctions/cache.ts +18 -3
  276. package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
  277. package/src/plugins/builtin/treasury-auctions/headless.ts +109 -19
  278. package/src/plugins/builtin/treasury-auctions/index.tsx +14 -4
  279. package/src/plugins/builtin/treasury-auctions/model.ts +256 -28
  280. package/src/plugins/builtin/treasury-auctions/pane.tsx +139 -28
  281. package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
  282. package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
  283. package/src/plugins/builtin/vol-surface/index.tsx +1 -1
  284. package/src/plugins/builtin/world-venue-map/index.ts +1 -0
  285. package/src/plugins/builtin/yield-curve/curves.ts +10 -4
  286. package/src/plugins/builtin/yield-curve/headless.ts +6 -2
  287. package/src/plugins/builtin/yield-curve/index.tsx +3 -3
  288. package/src/plugins/builtin/yield-curve/series.ts +10 -0
  289. package/src/plugins/builtin/yield-curve/world.ts +3 -1
  290. package/src/plugins/installer.ts +45 -0
  291. package/src/portfolio/column-values.ts +2 -1
  292. package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
  293. package/src/public/remote.ts +7 -1
  294. package/src/remote/client.ts +191 -11
  295. package/src/remote/controller-utils.ts +13 -1
  296. package/src/remote/controller.ts +88 -26
  297. package/src/remote/endpoint.ts +24 -0
  298. package/src/remote/form.ts +59 -4
  299. package/src/remote/resources.ts +56 -19
  300. package/src/remote/schema.ts +22 -9
  301. package/src/remote/secrets.ts +12 -0
  302. package/src/remote/semantic-helpers.ts +29 -1
  303. package/src/remote/semantic-tree.tsx +44 -15
  304. package/src/remote/server.ts +2 -1
  305. package/src/remote/surface.tsx +192 -0
  306. package/src/remote/types.ts +5 -0
  307. package/src/renderers/cloudflare/worker.ts +16 -1
  308. package/src/renderers/dom/styles.css +40 -6
  309. package/src/renderers/opentui/host.tsx +6 -0
  310. package/src/renderers/share/layout-view.tsx +1 -1
  311. package/src/series/standalone.ts +2 -2
  312. package/src/shares/api.ts +21 -4
  313. package/src/shares/item.ts +73 -0
  314. package/src/shares/pane-item.ts +205 -0
  315. package/src/shares/pane.ts +4 -0
  316. package/src/shares/payload.ts +9 -5
  317. package/src/sources/gloomberb-cloud/news.ts +37 -12
  318. package/src/state/opening-ticker-panes.ts +47 -0
  319. package/src/test-support/cli-context.ts +2 -0
  320. package/src/test-support/preload.ts +4 -1
  321. package/src/tickers/instrument-kind.ts +23 -3
  322. package/src/tickers/renamed-listings.ts +105 -0
  323. package/src/tickers/search/index.ts +103 -16
  324. package/src/time-series/resolve.ts +2 -2
  325. package/src/types/config.ts +5 -0
  326. package/src/types/context-menu.ts +2 -0
  327. package/src/types/financials.ts +1 -0
  328. package/src/types/plugin-commands.ts +140 -0
  329. package/src/types/plugin-context.ts +125 -0
  330. package/src/types/plugin-contributions.ts +55 -0
  331. package/src/types/plugin-definition.ts +234 -0
  332. package/src/types/plugin-notifications.ts +38 -0
  333. package/src/types/plugin-pane-settings.ts +116 -0
  334. package/src/types/plugin-pane-templates.ts +160 -0
  335. package/src/types/plugin-panes.ts +243 -0
  336. package/src/types/plugin-reports.ts +35 -0
  337. package/src/types/plugin-shared.ts +14 -0
  338. package/src/types/plugin-state.ts +71 -0
  339. package/src/types/plugin.ts +14 -1169
  340. package/src/ui/index.tsx +14 -3
  341. package/src/updater/github-releases.ts +23 -0
  342. package/src/utils/central-banks.ts +86 -1
  343. package/src/utils/cli-output.ts +22 -9
  344. package/src/utils/datetime-format.ts +12 -3
  345. package/src/utils/depositary-receipt.ts +28 -3
  346. package/src/utils/fundamentals.ts +14 -0
  347. package/src/utils/max-drawdown.ts +97 -16
  348. package/src/utils/untrusted-text.ts +29 -0
@@ -2,7 +2,7 @@ import type { FuturesContractTermsPayload } from "../../../api-client/futures-cu
2
2
  import type { Quote } from "../../../types/financials";
3
3
  import { compareSortValues, type SortDirection } from "../../../utils/sort-values";
4
4
  import type { BoardQuoteMap } from "../shared/use-quote-board";
5
- import { FUTURES_SECTOR_ORDER, type FuturesContract, type FuturesSector } from "../../../market-data/futures-board";
5
+ import { FUTURES_SECTOR_ORDER, futuresGroupFilter, futuresNameKey, type FuturesContract, type FuturesSector } from "../../../market-data/futures-board";
6
6
  import { CONTRACT_MONTH_NAME, futuresPriceUnit } from "../../../market-data/futures-contract";
7
7
  import { contractMonthLabel } from "../../../utils/contract-month";
8
8
  import { quoteDotMarketState } from "../../../market-data/market/status";
@@ -89,19 +89,21 @@ function dayMonth(date: string): string {
89
89
 
90
90
  /**
91
91
  * The row's headline: the contract its quote prices, as futuresContractName
92
- * words it: the root's front month until its roll date. Two notes follow,
93
- * each from the day's facts. Once the continuous symbol has rolled while the
94
- * nearer month still trades, that month's last trade: "WTI Crude Oil Dec 2026,
95
- * rolled (Nov expires 20 Oct)". When the day's volume put another month first,
96
- * that month: "WTI Crude Oil Nov 2026, Dec most active". The terms only add a
97
- * note when they name the month the quote prices, so a roll between the two
98
- * loads never mixes months, and place the month when the quote's name carries
99
- * none. A name column too narrow for a note drops it, the last one first.
92
+ * words it: the root's front month until its roll date. Once the continuous
93
+ * symbol has rolled while the nearer month still trades, a note gives that
94
+ * month's last trade: "WTI Crude Oil Dec 2026, rolled (Nov expires 20 Oct)".
95
+ * The label names only the contract whose price the row shows: the day's
96
+ * most active month, beside the price, read as that month's price ("Cocoa
97
+ * Dec 2026, Mar 2027 most active 5,119" was December's), so it stays in
98
+ * `quote`'s contract lines. The terms only add the note when they name the
99
+ * month the quote prices, so a roll between the two loads never mixes
100
+ * months, and place the month when the quote's name carries none. A name
101
+ * column too narrow for the note drops it.
100
102
  */
101
103
  export function futuresContractHeadline(
102
104
  contract: FuturesContract,
103
105
  quote?: Quote | null,
104
- terms?: Pick<FuturesContractTermsPayload, "deliveryMonth" | "nearest" | "mostActive"> | null,
106
+ terms?: Pick<FuturesContractTermsPayload, "deliveryMonth" | "nearest"> | null,
105
107
  width = Number.POSITIVE_INFINITY,
106
108
  ): string {
107
109
  const quoted = quotedContractMonth(contract, quote);
@@ -115,28 +117,13 @@ export function futuresContractHeadline(
115
117
  const priced = `${month.year}-${String(month.month + 1).padStart(2, "0")}`;
116
118
  const plain = `${contract.name} ${contractMonthLabel(month.year, month.month)}`;
117
119
  if (!agree) return plain;
118
- const notes: Array<{ text: string; min: string }> = [];
119
120
  const nearest = terms?.nearest;
120
- if (nearest && nearest.deliveryMonth < priced) {
121
- const nearer = MONTH_NAMES[Number(nearest.deliveryMonth.slice(5, 7)) - 1];
122
- const expiry = nearest.lastTrade ? `expires ${dayMonth(nearest.lastTrade)}` : "still trading";
123
- notes.push({ text: `, rolled (${nearer} ${expiry})`, min: ", rolled" });
124
- }
125
- const active = terms?.mostActive;
126
- if (active && /^\d{4}-\d{2}$/.test(active.deliveryMonth) && active.deliveryMonth !== priced) {
127
- // Another year's month says which year it is.
128
- const name = MONTH_NAMES[Number(active.deliveryMonth.slice(5, 7)) - 1];
129
- const label = active.deliveryMonth.slice(0, 4) === String(month.year) ? name : `${name} ${active.deliveryMonth.slice(0, 4)}`;
130
- notes.push({ text: `, ${label} most active`, min: `, ${label} most active` });
131
- }
132
- // The month the quote prices leads, so a column that clips the tail still shows it; a note keeps its place
121
+ if (!nearest || nearest.deliveryMonth >= priced) return plain;
122
+ const nearer = MONTH_NAMES[Number(nearest.deliveryMonth.slice(5, 7)) - 1];
123
+ const expiry = nearest.lastTrade ? `expires ${dayMonth(nearest.lastTrade)}` : "still trading";
124
+ // The month the quote prices leads, so a column that clips the tail still shows it; the note keeps its place
133
125
  // while the column fits at least its start.
134
- let headline = plain;
135
- for (const note of notes) {
136
- if (width < headline.length + note.min.length) break;
137
- headline += note.text;
138
- }
139
- return headline;
126
+ return width < plain.length + ", rolled".length ? plain : `${plain}, rolled (${nearer} ${expiry})`;
140
127
  }
141
128
 
142
129
  /**
@@ -148,13 +135,22 @@ export function futuresUnitLabel(contract: FuturesContract, terms?: Pick<Futures
148
135
  return futuresPriceUnit(contract, terms);
149
136
  }
150
137
 
138
+ /**
139
+ * Whether a row answers a search: its code, symbol, name or everyday names,
140
+ * a number marked as "No. 11" or "#11" alike ("SUGAR NO. 11", the CFTC's
141
+ * name, is Sugar #11), or a sector or group word that holds it (softs,
142
+ * grains, agriculture, metals, energy), which lists that group alone.
143
+ */
151
144
  function matchesFuturesSearch(contract: FuturesContract, query: string, quote?: Quote | null): boolean {
152
145
  const normalized = query.trim().toLowerCase();
153
146
  if (!normalized) return true;
147
+ const group = futuresGroupFilter(normalized);
148
+ if (group) return group(contract);
149
+ const named = futuresNameKey(normalized);
154
150
  return (
155
151
  contract.code.toLowerCase().includes(normalized)
156
- || contract.name.toLowerCase().includes(normalized)
157
- || futuresContractName(contract, quote).toLowerCase().includes(normalized)
152
+ || futuresNameKey(contract.name).includes(named)
153
+ || futuresNameKey(futuresContractName(contract, quote)).includes(named)
158
154
  || contract.symbol.toLowerCase().includes(normalized)
159
155
  // Everyday names the board's own does not hold: natgas is Natural Gas.
160
156
  || (contract.aliases ?? []).some((alias) => alias.includes(normalized))
@@ -1,5 +1,5 @@
1
1
  import type { SeriesDefinition } from "../../../series/types";
2
- import { FUTURES_CONTRACTS, FUTURES_SECTOR_LABELS, type FuturesContract } from "../../../market-data/futures-board";
2
+ import { FUTURES_CONTRACTS, FUTURES_SECTOR_LABELS, futuresGroupTags, type FuturesContract } from "../../../market-data/futures-board";
3
3
 
4
4
  /**
5
5
  * Grains and softs the board quotes in US cents with no unit of its own
@@ -37,14 +37,15 @@ const CONTRACT_TAGS: Readonly<Record<string, readonly string[]>> = {
37
37
  "6S": ["CHF", "franc", "swiss franc", "safe haven"],
38
38
  };
39
39
 
40
- /** Each continuous front-month contract on the futures board, as `FUT:ES`. */
40
+ /** Each continuous front-month contract on the futures board, as `FUT:ES`, found by its sector and group words too (`catalog softs`). */
41
41
  const FRONT_MONTH_SERIES: readonly SeriesDefinition[] = FUTURES_CONTRACTS.map((contract) => ({
42
42
  id: `fut:${contract.code}`,
43
43
  name: contract.name,
44
44
  unit: futuresSeriesUnit(contract),
45
45
  frequency: "daily",
46
46
  group: "Futures",
47
- tags: [contract.code, FUTURES_SECTOR_LABELS[contract.sector], "futures", "front month", ...CONTRACT_TAGS[contract.code] ?? []],
47
+ tags: [...new Set([contract.code, FUTURES_SECTOR_LABELS[contract.sector], ...futuresGroupTags(contract), "futures", "front month",
48
+ ...CONTRACT_TAGS[contract.code] ?? []])],
48
49
  expression: `FUT:${contract.code}`,
49
50
  }));
50
51
 
@@ -41,17 +41,24 @@ const DEFAULT_FUTURES_COLUMN_IDS = FUTURES_COLUMN_DEFS.map((column) => column.id
41
41
 
42
42
  /**
43
43
  * Extra columns only earn their width once the board is wide enough to keep a
44
- * readable contract name (24 cells or more); a narrow pane drops them instead
45
- * of clipping. The unit a price counts outranks its session change in points,
46
- * which the change in percent still gives. The previous close (the last price
47
- * less the change) goes first, then each row's quote time (the status line
48
- * dates the newest), which leaves a 1280-pixel shot room for "WTI Crude Oil
49
- * Dec 2026, rolled (Nov expires 20 Oct)".
44
+ * readable contract name: CONTRACT never gets fewer than 24 cells
45
+ * once a board can hold that much. Each threshold is the width where the
46
+ * column fits with CONTRACT still at 24, the session word (from 100 cells)
47
+ * included. The change in percent always shows, and the week's and month's
48
+ * returns come next: the unit a price counts goes after them, so a board
49
+ * fullscreen on an 80-cell terminal (78 cells) reads SYM CONTRACT LAST CHG%
50
+ * 1W, and a floating one never hides the move behind a scroll (a cent price
51
+ * still says so on itself, 280.15¢). The unit outranks the session change in
52
+ * points, which the change in percent still gives. The previous close (the
53
+ * last price less the change) goes first, then each row's quote time (the
54
+ * status line dates the newest), which leaves a 1280-pixel shot room for "WTI
55
+ * Crude Oil Dec 2026, rolled (Nov expires 20 Oct)".
50
56
  */
51
57
  const COLUMN_MIN_PANE_WIDTH: Partial<Record<FuturesColumnId, number>> = {
52
- change: 100,
53
- return1w: 108,
54
- return1m: 117,
58
+ return1w: 71,
59
+ return1m: 80,
60
+ unit: 106,
61
+ change: 117,
55
62
  returnYtd: 126,
56
63
  volume: 136,
57
64
  time: 170,
@@ -51,9 +51,9 @@ function loadTerms(symbol: string, batch: boolean): Promise<boolean> {
51
51
 
52
52
  /**
53
53
  * Each listed row's contract terms, as `quote` reads them: the unit its price
54
- * counts, the nearer month still trading once its continuous symbol has
55
- * rolled, and the day's most active month. Only the rows the board lists are asked for,
56
- * and a row whose terms have not arrived (or that has none) renders without them.
54
+ * counts and the nearer month still trading once its continuous symbol has
55
+ * rolled. Only the rows the board lists are asked for, and a row whose terms
56
+ * have not arrived (or that has none) renders without them.
57
57
  */
58
58
  export function useFuturesBoardTerms(contracts: readonly FuturesContract[], enabled: boolean): FuturesTermsMap {
59
59
  const symbolKey = contracts.map((contract) => contract.symbol).join(",");
@@ -5,7 +5,7 @@ import { formatPercentRaw } from "../../../utils/format";
5
5
  import { DATE_OPTION_EXAMPLES } from "../../../utils/calendar-date";
6
6
  import { newestReportTime, oldestReportTime } from "../../../utils/utc-time";
7
7
  import { fetchFuturesCurve, loadCurveSpot, loadCurveSpotBars, loadCurveSpotCloses, loadFuturesCurveAsOf } from "./client";
8
- import { basisSpotSymbol, BASIS_CONVENTION, blankBasisNote, catalogueCurveUnit, curveAsOfDate, curveCache, curveSpotBars, curveBasisPercent, curveBasisRows, curveChangeText, curveContractCode, curvePrice, curveReadsThirtySeconds, curveRoundedPrice, curveSpotSource, curveSpotPremium, curveSpreadLabel, curveTimestamp, curveNoTradeSince, curveSettleShown, curveUnitLabel, noTradeChangeNote, normalizeCurveRoot, shortDatedBasisNote, skippedSpreadNotice, spotIndexSymbol, thinSpreadNotice, unpairedContractCount, unsupportedCurveRootMessage, type ContractBasis, type CurveSpotPremium } from "./model";
8
+ import { basisSpotSymbol, BASIS_CONVENTION, blankBasisNote, catalogueCurveUnit, curveAsOfDate, curveCache, curveSpotBars, curveBasisPercent, curveBasisRows, curveChangeText, curveContractCode, curvePrice, curveReadsThirtySeconds, curveRoundedPrice, curveSpotSource, curveSpotPremium, curveSpreadLabel, curveTimestamp, curveNoTradeSince, curveSettleShown, curveUnitLabel, curveRootNamed, noTradeChangeNote, normalizeCurveRoot, shortDatedBasisNote, skippedSpreadNotice, spotIndexSymbol, thinSpreadNotice, unpairedContractCount, unsupportedCurveRootMessage, type ContractBasis, type CurveSpotPremium } from "./model";
9
9
  import { COMMODITIES_VIEW_STATE } from "../commodities-energy/view-state";
10
10
  import { knownGapMessage } from "../../../cli/known-gaps";
11
11
 
@@ -171,7 +171,7 @@ export const futuresCurveHeadless: HeadlessPaneDefinition<"bundle"> = {
171
171
  "Ann Basis is simple actual/365, each last trade against spot in the same minute, and noisy under 7 days to expiry."],
172
172
  intents: ["futures basis trade", "cash and carry", "basis against spot"],
173
173
  opens: [{ words: ["VX", "vix futures", "vix futures curve"], argument: "VIX" }] },
174
- shape: "bundle", argument: { kind: "free-text", optional: true, placeholder: "root", description: "FUT root such as CL, ES, ZN or VX, or a CME crypto root (BTC, ETH, SOL, XRP). Defaults to ES.",
174
+ shape: "bundle", argument: { kind: "free-text", optional: true, placeholder: "root", description: "FUT root such as CL, ES, ZN or VX, a CME crypto root (BTC, ETH, SOL, XRP), or a root's name (gold, natural gas, crude oil). Defaults to ES.",
175
175
  examples: ["VIX", "CL", "BTC"] },
176
176
  // Only the pane reads the tab; the report always carries both.
177
177
  options: [{ key: "tab", description: "Curve or the full contract table.", type: "enum",
@@ -181,7 +181,7 @@ export const futuresCurveHeadless: HeadlessPaneDefinition<"bundle"> = {
181
181
  describe: (args) => `Futures curve ${args.argument || DEFAULT_ROOT}`,
182
182
  async load(args, ctx) {
183
183
  const input = args.argument || DEFAULT_ROOT;
184
- const root = normalizeCurveRoot(input);
184
+ const root = normalizeCurveRoot(input) ?? curveRootNamed(input);
185
185
  if (!root) {
186
186
  // A subject no source carries (`fn CTM BDI`, the Baltic Dry Index) is said with its proxies, as search says it.
187
187
  const gap = typeof input === "string" ? knownGapMessage(input) : null;
@@ -4,7 +4,7 @@ import { futuresCurveHeadless } from "./headless";
4
4
  import { BASIS_FORMULA, CURVE_HORIZONS, CURVE_ROOTS, curveRootForTicker, curveTitle, DEFAULT_CURVE_HORIZON, normalizeCurveRoot } from "./model";
5
5
 
6
6
  export const futuresCurveModule: PluginModule = {
7
- panes: [{ id: "futures-curve", name: "Futures Curve", icon: "F", get component(): typeof import("./pane").FuturesCurvePane { const { FuturesCurvePane } = require("./pane"); return FuturesCurvePane; },
7
+ panes: [{ id: "futures-curve", name: "Futures Curve", icon: "F", shareItem: { argument: true }, get component(): typeof import("./pane").FuturesCurvePane { const { FuturesCurvePane } = require("./pane"); return FuturesCurvePane; },
8
8
  defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 98, height: 30 },
9
9
  tableExport: true, headless: futuresCurveHeadless,
10
10
  settings: (context) => ({ title: "Futures Curve Settings",
@@ -32,6 +32,24 @@ export function normalizeCurveRoot(value: unknown): string | null {
32
32
  return CURVE_ROOTS.some((row) => row.value === root) ? root : null;
33
33
  }
34
34
 
35
+ /** What a commodity is called rather than coded: the WTI and Brent crude curves by the words they are asked for in. */
36
+ const CURVE_ROOT_WORDS: Readonly<Record<string, string>> = { "CRUDE": "CL", "CRUDE OIL": "CL", "OIL": "CL", "WTI": "CL", "BRENT": "BZ" };
37
+
38
+ /**
39
+ * A root named in words, as a typed argument or a question asks for it
40
+ * ("gold", "Natural Gas futures", "crude oil"): a listed root's name, or a
41
+ * crude benchmark's. Not for the ticker under the cursor, where GOLD is a
42
+ * security, so only CTM's typed argument reads it.
43
+ */
44
+ export function curveRootNamed(value: unknown): string | null {
45
+ if (typeof value !== "string") return null;
46
+ const words = value.trim().toUpperCase().replace(/\s+/g, " ").replace(/( (FUTURES?|CURVE))+$/, "");
47
+ if (!words) return null;
48
+ return CURVE_ROOT_WORDS[words]
49
+ ?? CURVE_ROOTS.find((row) => row.label.toUpperCase() === `${row.value} ${words}`)?.value
50
+ ?? null;
51
+ }
52
+
35
53
  /**
36
54
  * A curve's window title, its root ("Curve · BZ"), so two curves open at once
37
55
  * are told apart in their windows and in the layout list.
@@ -5,7 +5,7 @@ import { GPU_MODELS, gpuArgument } from "./model";
5
5
  import { GPU_SERIES } from "./series";
6
6
 
7
7
  export const gpuModule: PluginModule = {
8
- panes: [{ id: "gpu", name: "GPU Rental Prices", icon: "G", get component(): typeof import("./pane").GpuPane { const { GpuPane } = require("./pane"); return GpuPane; }, defaultPosition: "right", defaultMode: "floating",
8
+ panes: [{ id: "gpu", name: "GPU Rental Prices", icon: "G", shareItem: { argument: true }, get component(): typeof import("./pane").GpuPane { const { GpuPane } = require("./pane"); return GpuPane; }, defaultPosition: "right", defaultMode: "floating",
9
9
  defaultFloatingSize: { width: 120, height: 34 }, tableExport: true, headless: gpuHeadless }],
10
10
  paneTemplates: [{ id: "gpu-pane", paneId: "gpu", label: "GPU Rental Prices",
11
11
  description: "Pro GPU rental list prices, provider-declared spot and marketplace asks, with sourced price history and related equities. Free preview available.",
@@ -154,7 +154,7 @@ export function FunctionsTable({
154
154
  search={{
155
155
  value: query,
156
156
  onChange: setQuery,
157
- placeholder: "function or description",
157
+ placeholder: ["function or description", "search functions"],
158
158
  focused,
159
159
  active: searching,
160
160
  onActiveChange: onSearchingChange,
@@ -23,6 +23,8 @@ import { logFailure } from "../../../utils/log-failure";
23
23
  import { VERSION } from "../../../version";
24
24
  import { getCurrentPluginTarget } from "../../current-target";
25
25
  import { openUrl } from "../../../components/ui/external-link";
26
+ import { useShortcut } from "../../../react/input";
27
+ import { isPlainKey } from "../../../utils/keyboard";
26
28
 
27
29
  const HELP_TABS = [
28
30
  { label: "Basics", value: "basics" },
@@ -68,7 +70,15 @@ const KEY_COLUMN_MAX_SHARE = 0.4;
68
70
 
69
71
  function HelpPane({ focused, width, height }: PaneProps) {
70
72
  const registry = getSharedRegistry();
71
- const { openCommandBar, showPane, createPaneFromTemplate } = usePluginAppActions();
73
+ const { openCommandBar, showPane, hidePane, createPaneFromTemplate } = usePluginAppActions();
74
+ // Esc closes Help, once nothing in it took the key: a search, a key
75
+ // capture or a form backs out first.
76
+ useShortcut((event) => {
77
+ if (!isPlainKey(event, "escape", "esc")) return;
78
+ event.preventDefault();
79
+ event.stopPropagation();
80
+ hidePane("help");
81
+ }, { phase: "idle", enabled: focused });
72
82
  // A key capture requested from the command bar belongs to the Shortcuts
73
83
  // tab, whether the pane is already open or is being opened for it.
74
84
  const [activeTabId, setActiveTabId] = usePluginPaneState<HelpTabId>("activeTab", "basics");
@@ -357,7 +367,7 @@ function HelpPane({ focused, width, height }: PaneProps) {
357
367
  ],
358
368
  },
359
369
  {
360
- // Docked panes keep the saved layout and floating ones follow the pointer; the keyboard's way is Window Mode below.
370
+ // Panes in the layout keep the saved layout and floating ones follow the pointer; the keyboard's way is Window Mode below.
361
371
  label: "Layout",
362
372
  items: [
363
373
  keyEntry("layout-drag", ["Drag"], "Floating panes can be dragged by the title bar and resized from the lower-right corner."),
@@ -374,8 +384,8 @@ function HelpPane({ focused, width, height }: PaneProps) {
374
384
  ? [entry("enter-resize", windowResizeBadges, "Enter window mode to resize the focused window.")]
375
385
  : []),
376
386
  keyEntry("mode", ["m", "r"], "Switch between move and resize."),
377
- keyEntry("dock", ["d"], "Dock or float the selected window."),
378
- keyEntry("move", ["Arrows", "h/j/k/l"], "Move, resize, or choose a dock target."),
387
+ keyEntry("float", ["d"], "Float the selected window, or return it to the layout."),
388
+ keyEntry("move", ["Arrows", "h/j/k/l"], "Move, resize, or choose where it goes in the layout."),
379
389
  keyEntry("step", ["Shift"], "Use larger move and resize steps with direction keys."),
380
390
  keyEntry("cycle", ["Tab", "w"], "Cycle windows or resize handles."),
381
391
  keyEntry("commit", ["Enter", "Esc"], "Commit pending changes or exit window mode."),
@@ -61,8 +61,19 @@ import { badgeCell, badgeColumnWidth, mutedCell } from "./table-cells";
61
61
  const CAPTURE_SCOPE = "help-keybinding-capture";
62
62
  const FOOTER_ID = "help-keybindings";
63
63
  const NOTE_COLUMN_WIDTH = 26;
64
- /** Below this the note column is dropped; the footer still carries the detail. */
65
- const NOTE_COLUMN_MIN_TABLE_WIDTH = 76;
64
+ /** What the table takes besides its columns: its side padding, the gaps between columns and the scrollbar. */
65
+ const TABLE_CHROME = 5;
66
+ /** ACTION keeps at least this beside NOTE; narrower, NOTE is dropped and the footer carries the selected row's. */
67
+ const ACTION_MIN_WIDTH = 30;
68
+
69
+ /**
70
+ * Whether the NOTE column shows: only while some row has a note, and ACTION
71
+ * keeps ACTION_MIN_WIDTH cells beside it. At 80 cells an empty NOTE took 26
72
+ * while ACTION read "Change the focused pa…".
73
+ */
74
+ function showsKeybindingNotes(width: number, keyColumnWidth: number, anyNote: boolean): boolean {
75
+ return anyNote && width - TABLE_CHROME - keyColumnWidth - NOTE_COLUMN_WIDTH >= ACTION_MIN_WIDTH;
76
+ }
66
77
 
67
78
  type KeybindingColumnId = "key" | "action" | "note";
68
79
  type KeybindingColumn = DataTableColumn & { id: KeybindingColumnId };
@@ -245,7 +256,7 @@ export function KeybindingsEditor({
245
256
  return;
246
257
  }
247
258
  // A built-in action's key is refused, so a binding never leaves the command bar or close pane dead.
248
- const core = coreActionOnChord(resolved, chord, capture.kind === "row" ? capture.row.action?.id : undefined);
259
+ const core = coreActionOnChord(resolved, chord, capture.kind === "row" ? capture.row.action?.id : undefined, { command: isCommand });
249
260
  if (core) {
250
261
  setFeedback({ tone: "warning", text: takenChordMessage(formatChord(chord), core) });
251
262
  return;
@@ -371,13 +382,16 @@ export function KeybindingsEditor({
371
382
  () => badgeColumnWidth([...bindableRows.map((row) => row.chords), [t("Press a key")]]),
372
383
  [bindableRows],
373
384
  );
385
+ // Decided from every row, not the rows on screen, so ACTION's width holds while the table scrolls.
386
+ const anyNote = useMemo(() => bindableRows.some((row) => !!row.note), [bindableRows]);
387
+ const showNotes = showsKeybindingNotes(width, keyColumnWidth, anyNote);
374
388
  const columns = useMemo<KeybindingColumn[]>(() => [
375
389
  { id: "key", label: "KEY", width: keyColumnWidth, align: "left" },
376
390
  { id: "action", label: "ACTION", width: 20, align: "left", flexGrow: 1 },
377
- ...(width >= NOTE_COLUMN_MIN_TABLE_WIDTH
391
+ ...(showNotes
378
392
  ? [{ id: "note" as const, label: "NOTE", width: NOTE_COLUMN_WIDTH, align: "left" as const }]
379
393
  : []),
380
- ], [keyColumnWidth, width]);
394
+ ], [keyColumnWidth, showNotes]);
381
395
 
382
396
  const renderCell = useCallback((
383
397
  row: EditorRow,
@@ -25,6 +25,7 @@ export const holdersModule: PluginModule = {
25
25
  icon: "H",
26
26
  get component(): typeof import("./pane").HoldersView { const { HoldersView } = require("./pane"); return HoldersView; },
27
27
  defaultPosition: "right",
28
+ shareItem: { ticker: true },
28
29
  tickerFollower: true,
29
30
  defaultMode: "floating",
30
31
  defaultFloatingSize: { width: 105, height: 34 },
@@ -139,10 +139,10 @@ export function holderShareBasisMarker(row: { shareBasis?: unknown }): string {
139
139
  * line are positions in the receipts, or that a receipt line's rows all are.
140
140
  */
141
141
  export function holderShareBasisNote(
142
- data: Pick<HolderData, "shareBasis" | "adrRatio">,
142
+ data: Pick<HolderData, "shareBasis" | "adrRatio" | "depositaryPair">,
143
143
  rows: ReadonlyArray<{ shareBasis?: unknown }>,
144
144
  ): string | null {
145
- const ratio = adrRatioText(data.adrRatio);
145
+ const ratio = adrRatioText(data.adrRatio, data.depositaryPair?.ordinary[0]);
146
146
  const each = ratio ? ` (${ratio})` : "";
147
147
  if (rows.some((row) => holderShareBasisMarker(row))) return `ADR: shares held as depositary receipts${each}.`;
148
148
  if (rows.length > 0 && data.shareBasis === "depositary_receipt") return `Shares are depositary receipts${each}.`;
@@ -728,6 +728,7 @@ export const insiderModule: PluginModule = {
728
728
  icon: "I",
729
729
  component: InsiderPane,
730
730
  defaultPosition: "right",
731
+ shareItem: { ticker: true },
731
732
  tickerFollower: true,
732
733
  instruments: ["equity"],
733
734
  defaultMode: "floating",
@@ -10,7 +10,7 @@ export const ivHistoryModule: PluginModule = {
10
10
  series: IV_SERIES,
11
11
  panes: [{
12
12
  id: "iv-history", name: "Implied Volatility History", icon: "V", get component(): typeof import("./pane").IvHistoryPane { const { IvHistoryPane } = require("./pane"); return IvHistoryPane; },
13
- defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 118, height: 36 },
13
+ defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 118, height: 36 },
14
14
  tableExport: true,
15
15
  settings: { title: "Implied Volatility History", fields: [
16
16
  { key: "lookback", label: "Lookback", type: "select", options: [{ value: "1Y", label: "1 year" }, { value: "2Y", label: "2 years" }, { value: "ALL", label: "All stored" }] },
@@ -39,6 +39,7 @@ export const jobsModule: PluginModule = {
39
39
  icon: "J",
40
40
  component: JobsPane,
41
41
  defaultPosition: "right",
42
+ shareItem: { ticker: true },
42
43
  tickerFollower: true,
43
44
  instruments: ["equity"],
44
45
  defaultMode: "floating",
@@ -145,7 +145,7 @@ export const layoutManagerModule: PluginModule = {
145
145
  ctx.registerCommand({
146
146
  id: "float-pane",
147
147
  label: "Float Pane",
148
- description: "Detach a docked pane into a floating window",
148
+ description: "Take a pane out of the layout into a floating window",
149
149
  keywords: ["float", "detach", "undock", "window", "pane"],
150
150
  category: "config",
151
151
  execute: async () => {
@@ -154,7 +154,7 @@ export const layoutManagerModule: PluginModule = {
154
154
  const { layout, termWidth, termHeight, focusedPaneId } = getStateRef();
155
155
  const focusedPane = getFocusedPane(layout, focusedPaneId);
156
156
  if (!focusedPane || !isPaneDocked(layout, focusedPane.instanceId)) {
157
- notify("Focus a docked pane to float it", { type: "info" });
157
+ notify("Focus a pane in the layout to float it", { type: "info" });
158
158
  return;
159
159
  }
160
160
 
@@ -167,9 +167,9 @@ export const layoutManagerModule: PluginModule = {
167
167
 
168
168
  ctx.registerCommand({
169
169
  id: "dock-pane",
170
- label: "Dock Pane",
171
- description: "Dock a floating pane back into the layout",
172
- keywords: ["dock", "attach", "pin", "pane"],
170
+ label: "Return to Layout",
171
+ description: "Put a floating pane back into the layout",
172
+ keywords: ["return", "layout", "tile", "attach", "pin", "pane", "dock"],
173
173
  category: "config",
174
174
  execute: async () => {
175
175
  if (!getStateRef) return;
@@ -177,7 +177,7 @@ export const layoutManagerModule: PluginModule = {
177
177
  const { layout, focusedPaneId } = getStateRef();
178
178
  const focusedPane = getFocusedPane(layout, focusedPaneId);
179
179
  if (!focusedPane || !layout.floating.some((entry) => entry.instanceId === focusedPane.instanceId)) {
180
- notify("Focus a floating pane to dock it", { type: "info" });
180
+ notify("Focus a floating pane to return it to the layout", { type: "info" });
181
181
  return;
182
182
  }
183
183
 
@@ -281,11 +281,11 @@ export const layoutManagerModule: PluginModule = {
281
281
  const focusedPane = getFocusedPane(layout, focusedPaneId);
282
282
  const dockedPaneIds = getDockedPaneIds(layout);
283
283
  if (dockedPaneIds.length < 2) {
284
- notify("Need at least 2 docked panes to swap", { type: "info" });
284
+ notify("Need at least 2 panes in the layout to swap", { type: "info" });
285
285
  return;
286
286
  }
287
287
  if (!focusedPane || !isPaneDocked(layout, focusedPane.instanceId)) {
288
- notify("Focus a docked pane to swap it", { type: "info" });
288
+ notify("Focus a pane in the layout to swap it", { type: "info" });
289
289
  return;
290
290
  }
291
291
 
@@ -2,9 +2,10 @@ import type { HeadlessPaneDefinition } from "../../../types/plugin";
2
2
  import { resolveHeadlessInstrument } from "../shared/headless-market-data";
3
3
  import { loadMacroDayEarnings, loadMacroDayHistory, loadMacroDaySeriesHistory, loadMacroReleases, macroDayEarningsNotice, type MacroDayEarnings } from "./client";
4
4
  import { fredSeriesArgument } from "../../../series/fred-argument";
5
- import { formatMacroDayMove, macroDayEventLabel, macroDayStats, matchesSurprise, projectMacroDays, type MacroDayStats } from "./model";
5
+ import { formatMacroDayMove, macroDayEventLabel, macroDayReleaseName, macroDayStats, macroFigureGapNotices, matchesSurprise, projectMacroDays, type MacroDayEvent,
6
+ type MacroDayStats } from "./model";
6
7
  import { MACRO_EVENT_KINDS, MACRO_EVENT_LABELS, MACRO_RELEASE_SOURCES, MACRO_SURPRISE_LABELS, MACRO_SURPRISES, staleMacroReleasesNotice,
7
- type MacroEventKind, type MacroSurprise } from "./releases";
8
+ type MacroEventKind, type MacroReleaseFigures, type MacroSurprise } from "./releases";
8
9
 
9
10
  // A mean that rounds to zero reads 0.00%, never -0.00%.
10
11
  const percent = (value: unknown) => typeof value !== "number" ? "--" : /[1-9]/.test((value * 100).toFixed(2)) ? `${(value * 100).toFixed(2)}%` : "0.00%";
@@ -22,7 +23,8 @@ export const macroDayHeadless: HeadlessPaneDefinition<"bundle"> = {
22
23
  discovery: { screenshotReadiness: "live-dom", limitations: [
23
24
  "US listings, or a FRED series (FRED:T10Y2Y, whose moves in a rate or spread read in bp); close-to-close on the release day.",
24
25
  "Published CPI, jobs and FOMC days, and Brazil's IPCA days from Gloom Cloud; sessions after the list's last covered day (releasesThrough) are left out.",
25
- "Actual, forecast and prior for the days Gloom Cloud has them (the US headlines from its kept economic calendar, IPCA from the central bank's SGS series); --surprise keeps the days that came in hot, cool or in line with the forecast.",
26
+ "Actual, forecast and prior for the days Gloom Cloud has them (the US headlines from its kept economic calendar, under either feed's title; an FOMC day's are the federal funds target range and whether it held or moved; IPCA from the central bank's SGS series); --surprise keeps the days that came in hot, cool or in line with the forecast.",
27
+ "A release day without figures says why: before the kept calendar starts, or listed without them.",
26
28
  "A release day that is also the reaction session of the company's own earnings report is marked earnings and left out of the release averages and the normal day.",
27
29
  ] },
28
30
  options: [
@@ -61,6 +63,15 @@ export const macroDayHeadless: HeadlessPaneDefinition<"bundle"> = {
61
63
  // The days the filter keeps get a row of their own: how the name moved on hot CPI days.
62
64
  const selected = surprise === "all" ? [] : [row(`${MACRO_SURPRISE_LABELS[surprise]} ${release === "all" ? "release"
63
65
  : MACRO_EVENT_LABELS[release as MacroEventKind]}`, macroDayStats(events, model.normal.meanAbs))];
66
+ // A day without figures says why: before the kept calendar (one note for them all), or the calendar's own gap.
67
+ const figuresFrom = releases.figuresFrom;
68
+ const beforeCalendar = (event: MacroDayEvent) => !!figuresFrom && event.kind !== "ipca" && !event.figures && event.date < figuresFrom;
69
+ const missing = (event: MacroDayEvent) => event.figures ? null : event.figuresMissing
70
+ ?? (beforeCalendar(event) ? `before ${figuresFrom}, when Gloom Cloud's economic calendar starts` : null);
71
+ const figureNotes = [
72
+ ...(events.some(beforeCalendar) ? [`Release days before ${figuresFrom} have no actual, forecast or prior: Gloom Cloud's economic calendar starts then.`] : []),
73
+ ...macroFigureGapNotices(events),
74
+ ];
64
75
  return {
65
76
  sections: [
66
77
  { title: "By release", columns: [{ key: "label", header: "Day" }, { key: "count", header: "Days" },
@@ -68,18 +79,26 @@ export const macroDayHeadless: HeadlessPaneDefinition<"bundle"> = {
68
79
  { key: "mean", header: header("Avg move"), format: move }, { key: "hitRate", header: "Up", format: share }],
69
80
  rows: [...model.kinds.map((kind) => row(MACRO_EVENT_LABELS[kind], model.byKind[kind])), ...selected,
70
81
  row(model.kinds.includes("ipca") ? "Any US release" : "Any release", model.allEvents), ...(model.earnings.count ? [row("Earnings", model.earnings)] : []), row("Normal day", model.normal)] },
71
- { title: "Release days", columns: [{ key: "date", header: "Date" }, { key: "event", header: "Release" },
82
+ { title: "Release days", columns: [{ key: "date", header: "Date" },
83
+ // The text table reads the decision beside its release (FOMC held), as the pane does; exports keep the two apart.
84
+ { key: "event", header: "Release", textFormat: (_value, row) => macroDayEventLabel({ kind: row.kind as MacroEventKind,
85
+ earnings: row.earnings === true, figures: typeof row.decision === "string" ? { decision: row.decision } as MacroReleaseFigures : null }) },
72
86
  { key: "actual", header: "Actual" }, { key: "forecast", header: "Forecast" }, { key: "prior", header: "Prior" },
73
87
  { key: "surprise", header: "Surprise" },
74
88
  { key: "session", header: "Session" }, { key: "move", header: header("Move"), format: move }, { key: "multiple", header: "vs normal", format: multiple }],
75
- rows: events.map(({ figures, ...event }) => ({ ...event, event: macroDayEventLabel(event), actual: figures?.actual ?? null,
76
- forecast: figures?.forecast ?? null, prior: figures?.prior ?? null, surprise: figures?.surprise ?? null,
77
- ...(figures ? { headline: figures.event } : {}) })) },
89
+ rows: events.map((day) => {
90
+ const { figures, figuresMissing: _gap, ...event } = day;
91
+ const why = missing(day);
92
+ return { ...event, event: macroDayReleaseName(day), actual: figures?.actual ?? null,
93
+ forecast: figures?.forecast ?? null, prior: figures?.prior ?? null, surprise: figures?.surprise ?? null,
94
+ ...(figures ? { headline: figures.event } : {}), ...(figures?.decision ? { decision: figures.decision } : {}),
95
+ ...(why ? { figuresMissing: why } : {}) };
96
+ }) },
78
97
  ],
79
98
  complete: !history.stale && !earnings.stale && !history.error && !notes.length && model.events.length > 0,
80
99
  unavailableSymbols: model.events.length ? [] : [symbol],
81
100
  errors: history.error ? [history.error] : [],
82
- ...(notes.length ? { notes } : {}),
101
+ ...(notes.length || figureNotes.length ? { notes: [...notes, ...figureNotes] } : {}),
83
102
  metadata: { unit: yieldMoves ? `change in the ${seriesId ? "rate" : "yield"} in percentage points, close to close on the release day`
84
103
  : "decimal return, close to close on the release day", start: model.start, asOf: model.asOf,
85
104
  releasesThrough: releases.coveredThrough, releaseSources: Object.values(MACRO_RELEASE_SOURCES),
@@ -7,7 +7,7 @@ import { LOOKBACK_OPTIONS, MacroDayPane } from "./pane";
7
7
  export const macroDayModule: PluginModule = {
8
8
  panes: [{
9
9
  id: "macro-day", name: "Macro-Day Reaction", icon: "M", component: MacroDayPane,
10
- defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 76, height: 26 },
10
+ defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 76, height: 26 },
11
11
  tableExport: true,
12
12
  settings: { title: "Macro-Day Reaction Settings", fields: [
13
13
  { key: "lookbackYears", label: "Lookback", type: "select", options: LOOKBACK_OPTIONS },
@@ -62,6 +62,8 @@ export interface MacroDayEvent {
62
62
  multiple: number | null;
63
63
  /** What the release came out with, when the list has it. */
64
64
  figures: MacroReleaseFigures | null;
65
+ /** Why it has none, when the list says. */
66
+ figuresMissing?: string;
65
67
  }
66
68
 
67
69
  export interface MacroDayStats {
@@ -97,10 +99,23 @@ export interface MacroDayModel {
97
99
  asOf: string | null;
98
100
  }
99
101
 
100
- /** The release's name, with the earnings marker on a day that is the ticker's own report reaction. */
101
- export const macroDayEventLabel = (event: Pick<MacroDayEvent, "kind" | "earnings">) =>
102
+ /** The release's name as it reads in the table: a policy decision's move after it (FOMC held), and the earnings marker. */
103
+ export const macroDayEventLabel = (event: Pick<MacroDayEvent, "kind" | "earnings" | "figures">) =>
104
+ [MACRO_EVENT_LABELS[event.kind], macroDayEventNote(event)].filter(Boolean).join(" ");
105
+
106
+ /** The release's name alone, with the earnings marker, as exports name it: the decision is a field of its own. */
107
+ export const macroDayReleaseName = (event: Pick<MacroDayEvent, "kind" | "earnings">) =>
102
108
  event.earnings ? `${MACRO_EVENT_LABELS[event.kind]} (earnings)` : MACRO_EVENT_LABELS[event.kind];
103
109
 
110
+ /** One line for each release day the economic calendar covers that has no figures, saying why. */
111
+ export const macroFigureGapNotices = (events: readonly Pick<MacroDayEvent, "kind" | "date" | "figures" | "figuresMissing">[]) =>
112
+ events.filter((event) => !event.figures && event.figuresMissing)
113
+ .map((event) => `${event.date} ${MACRO_EVENT_LABELS[event.kind]} has no figures: ${event.figuresMissing}.`);
114
+
115
+ /** What a row adds to its release's name: a policy decision's move, and the earnings marker. */
116
+ export const macroDayEventNote = (event: Pick<MacroDayEvent, "earnings" | "figures">) =>
117
+ [event.figures?.decision, event.earnings ? "(earnings)" : null].filter(Boolean).join(" ");
118
+
104
119
  /** Daily labels at UTC midnight name that date; any other stamp reads in New York. */
105
120
  function sessionDate(time: number): string {
106
121
  if (time % DAY_MS === 0) return new Date(time).toISOString().slice(0, 10);
@@ -215,7 +230,8 @@ export function projectMacroDays(history: readonly PricePoint[], options: {
215
230
  const move = moves.get(session);
216
231
  if (move == null || (session !== release.date && skipsAnotherWeekday(release.date, sessions[at - 1]!, session))) continue;
217
232
  if (US_KINDS.has(release.kind)) reactionSessions.add(session);
218
- found.push({ kind: release.kind, date: release.date, session, move, figures: release.figures ?? null });
233
+ found.push({ kind: release.kind, date: release.date, session, move, figures: release.figures ?? null,
234
+ ...(release.figuresMissing ? { figuresMissing: release.figuresMissing } : {}) });
219
235
  }
220
236
 
221
237
  const normalMoves = [...moves].filter(([date]) => !reactionSessions.has(date)).map(([, move]) => move);