@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
@@ -14,7 +14,8 @@ import type { PaneProps } from "../../../types/plugin";
14
14
  import { Box } from "../../../ui";
15
15
  import { loadMacroDayEarnings, loadMacroDayHistory, loadMacroReleases, macroDayEarningsNotice } from "./client";
16
16
  import {
17
- formatMacroDayMove, macroDayEventLabel, macroDayMoveDecimals, macroDayStats, matchesSurprise, projectMacroDays, type MacroDayEvent,
17
+ formatMacroDayMove, macroDayEventLabel, macroDayEventNote, macroDayMoveDecimals, macroDayStats, matchesSurprise, macroFigureGapNotices,
18
+ projectMacroDays, type MacroDayEvent,
18
19
  type MacroDayModel, type MacroDayMoveBasis,
19
20
  } from "./model";
20
21
  import { MACRO_EVENT_KINDS, MACRO_EVENT_LABELS, MACRO_SURPRISE_LABELS, MACRO_SURPRISES, staleMacroReleasesNotice, type MacroEventKind,
@@ -26,7 +27,6 @@ const SURPRISE_OPTIONS = [{ value: "all", label: "All" }, ...MACRO_SURPRISES.map
26
27
 
27
28
  const times = (value: number | null | undefined) => value == null ? "--" : `${value.toFixed(1)}x`;
28
29
 
29
- const EARNINGS_MARK = "earnings";
30
30
  const DATE: DataTableColumn = { id: "date", label: "Date", width: 19, align: "left" };
31
31
  /** The move and its multiple of a normal day's; a yield's move is in basis points, and its header says so. */
32
32
  const moveColumns = (basis: MacroDayMoveBasis): DataTableColumn[] => [
@@ -44,14 +44,16 @@ function figureColumns(rows: readonly MacroDayEvent[]): DataTableColumn[] {
44
44
  }
45
45
 
46
46
  /**
47
- * With every release listed, the release's name, widened to take the earnings marker where a row has one. With one
48
- * selected, a column only for the marker: every row would repeat the name.
47
+ * With every release listed, the release's name, widened to take a policy decision and the earnings marker where a row
48
+ * has them. With one selected, a column only for those: every row would repeat the name.
49
49
  */
50
50
  export function columnsFor(release: string, rows: readonly MacroDayEvent[], basis: MacroDayMoveBasis = "return"): DataTableColumn[] {
51
- const marked = rows.some((event) => event.earnings);
52
51
  const values = [...figureColumns(rows), ...moveColumns(basis)];
53
- if (release === "all") return [DATE, { id: "release", label: "Release", width: marked ? 15 : 8, align: "left" }, ...values];
54
- return marked ? [DATE, { id: "release", label: "Note", width: EARNINGS_MARK.length, align: "left" }, ...values] : [DATE, ...values];
52
+ if (release === "all") return [DATE, { id: "release", label: "Release", align: "left",
53
+ width: tableColumnWidth({ label: "Release", width: Math.max(6, ...rows.map((event) => displayWidth(macroDayEventLabel(event)))) }) }, ...values];
54
+ const notes = rows.map((event) => displayWidth(macroDayEventNote(event)));
55
+ return notes.some(Boolean) ? [DATE, { id: "release", label: "Note", align: "left", width: tableColumnWidth({ label: "Note", width: Math.max(...notes) }) },
56
+ ...values] : [DATE, ...values];
55
57
  }
56
58
 
57
59
  /** By the sign the text shows: an average that rounds to 0.00% (or 0.0bp) is neither up nor down. */
@@ -127,8 +129,11 @@ export function MacroDayPane({ width, height, focused }: PaneProps) {
127
129
  [model, release, surprise, rows]);
128
130
  const columns = useMemo(() => columnsFor(release, rows, model?.basis), [model?.basis, release, rows]);
129
131
 
132
+ // A covered release day the calendar left without figures says why; days before the calendar are the docs' to explain.
133
+ const figureGaps = useMemo(() => macroFigureGapNotices(rows), [rows]);
130
134
  usePaneNoticeFooter({ registrationId: "macro-day-notices", focused,
131
- notices: [...new Set([identityError, history.error, history.data?.error, releasesNotice, earningsNotice].filter((value): value is string => !!value))] });
135
+ notices: [...new Set([identityError, history.error, history.data?.error, releasesNotice, earningsNotice, ...figureGaps]
136
+ .filter((value): value is string => !!value))] });
132
137
  usePaneFooter("macro-day", () => ({ info: [
133
138
  ...(history.loading ? [{ id: "loading", parts: [{ text: "loading history", tone: "muted" as const }] }] : []),
134
139
  ...(history.data?.stale || history.data?.earnings.stale ? [{ id: "stale", parts: [{ text: "stale history", tone: "warning" as const }] }] : []),
@@ -137,7 +142,7 @@ export function MacroDayPane({ width, height, focused }: PaneProps) {
137
142
 
138
143
  const renderCell = useCallback((event: MacroDayEvent, column: DataTableColumn): DataTableCell => {
139
144
  if (column.id === "date") return { text: event.session === event.date ? event.date : `${event.date} → ${event.session.slice(5)}`, value: event.date };
140
- if (column.id === "release") return { text: release === "all" ? macroDayEventLabel(event) : event.earnings ? EARNINGS_MARK : "" };
145
+ if (column.id === "release") return { text: release === "all" ? macroDayEventLabel(event) : macroDayEventNote(event) };
141
146
  // The print colored against the consensus, as the economic calendar colors it.
142
147
  if (column.id === "actual") return { text: event.figures?.actual ?? "", color: event.figures?.surprise === "hot" ? colors.positive
143
148
  : event.figures?.surprise === "cool" ? colors.negative : undefined };
@@ -39,15 +39,25 @@ export interface MacroReleaseFigures {
39
39
  forecast: string | null;
40
40
  prior: string | null;
41
41
  surprise: MacroSurprise | null;
42
+ /** A policy decision's move: "held", "cut 25bp", "raised 50bp". */
43
+ decision?: string;
42
44
  }
43
45
 
44
- export interface MacroRelease { kind: MacroEventKind; date: string; figures?: MacroReleaseFigures }
46
+ export interface MacroRelease {
47
+ kind: MacroEventKind;
48
+ date: string;
49
+ figures?: MacroReleaseFigures;
50
+ /** Why a day Gloom Cloud's economic calendar covers has no figures: it lists the release without them, or not at all. */
51
+ figuresMissing?: string;
52
+ }
45
53
 
46
54
  export interface MacroReleaseList {
47
55
  /** Oldest first. */
48
56
  releases: MacroRelease[];
49
57
  /** The last day the list is complete for: later sessions are left out, release day or not. */
50
58
  coveredThrough: string;
59
+ /** The first day Gloom Cloud's economic calendar covers: US days before it have no figures. */
60
+ figuresFrom?: string;
51
61
  }
52
62
 
53
63
  const DAY_MS = 86_400_000;
@@ -70,19 +80,24 @@ function servedFigures(value: unknown): MacroReleaseFigures | undefined {
70
80
  const event = text(figures?.event);
71
81
  if (!event) return undefined;
72
82
  const surprise = MACRO_SURPRISES.find((candidate) => candidate === figures?.surprise) ?? null;
73
- return { event, actual: text(figures?.actual), forecast: text(figures?.forecast), prior: text(figures?.prior), surprise };
83
+ const decision = text(figures?.decision);
84
+ return { event, actual: text(figures?.actual), forecast: text(figures?.forecast), prior: text(figures?.prior), surprise,
85
+ ...(decision ? { decision } : {}) };
74
86
  }
75
87
 
76
88
  /**
77
89
  * The served list extends the floor past its end; the floor keeps its own
78
90
  * days up to there. IPCA, which the floor does not carry, is the served list's
79
91
  * through its end, and left out when the server lists none. Every day takes
80
- * the figures the server has for it. A served list that breaks the contract,
81
- * or ends no later than the floor, adds nothing.
92
+ * the figures the server has for it, or the reason it gives for having none;
93
+ * US days before its economic calendar (`figuresFrom`) have none. A served
94
+ * list that breaks the contract, or ends no later than the floor, adds
95
+ * nothing.
82
96
  */
83
97
  export function mergeMacroReleases(floor: MacroReleaseList, served: unknown): MacroReleaseList {
84
98
  const payload = served as { coveredThrough?: unknown; releases?: Partial<Record<MacroEventKind, unknown>>;
85
- figures?: Partial<Record<MacroEventKind, Record<string, unknown>>> } | null;
99
+ figures?: Partial<Record<MacroEventKind, Record<string, unknown>>>; figuresFrom?: unknown;
100
+ figureGaps?: Partial<Record<MacroEventKind, Record<string, unknown>>> } | null;
86
101
  const coveredThrough = payload?.coveredThrough;
87
102
  if (!isDate(coveredThrough) || coveredThrough <= floor.coveredThrough) return floor;
88
103
  const later: MacroRelease[] = [];
@@ -97,11 +112,14 @@ export function mergeMacroReleases(floor: MacroReleaseList, served: unknown): Ma
97
112
  if (Array.isArray(ipca) && ipca.every(isDate)) {
98
113
  for (const date of new Set(ipca)) if (date <= coveredThrough) later.push({ kind: "ipca", date });
99
114
  }
115
+ const figuresFrom = isDate(payload?.figuresFrom) ? payload.figuresFrom : null;
100
116
  const figuresOf = (release: MacroRelease): MacroRelease => {
101
117
  const figures = servedFigures(payload?.figures?.[release.kind]?.[release.date]);
102
- return figures ? { ...release, figures } : release;
118
+ if (figures) return { ...release, figures };
119
+ const missing = text(payload?.figureGaps?.[release.kind]?.[release.date]);
120
+ return missing ? { ...release, figuresMissing: missing } : release;
103
121
  };
104
- return { releases: [...floor.releases, ...later].map(figuresOf).sort(byDate), coveredThrough };
122
+ return { releases: [...floor.releases, ...later].map(figuresOf).sort(byDate), coveredThrough, ...(figuresFrom ? { figuresFrom } : {}) };
105
123
  }
106
124
 
107
125
  /** Whole days from the list's last covered day to today in New York. */
@@ -40,6 +40,7 @@ export const marketValuationModule: PluginModule = {
40
40
  id: MARKET_VALUATION_PANE_ID,
41
41
  name: "Market Valuation",
42
42
  icon: "V",
43
+ shareItem: { open: true, argument: true },
43
44
  get component(): typeof import("./pane").MarketValuationPane { const { MarketValuationPane } = require("./pane"); return MarketValuationPane; },
44
45
  defaultPosition: "right",
45
46
  defaultMode: "floating",
@@ -66,6 +66,13 @@ function buildColumns(width: number, stacked: boolean): Column[] {
66
66
  ];
67
67
  }
68
68
 
69
+ /** A link to the pane names the indicator its chart shows, with its reading. */
70
+ function indicatorShareItem(row: IndicatorRow) {
71
+ const cells = cellsFor(row);
72
+ const reading = row.view?.zone ? [cells.value.text, row.view.zone.label].filter(Boolean).join(" · ") : null;
73
+ return { title: row.indicator.label, excerpt: reading };
74
+ }
75
+
69
76
  // Stable table adapters so memoized rows survive pane re-renders.
70
77
  const indicatorKey = (row: IndicatorRow) => row.indicator.id;
71
78
  const renderIndicatorCell = (row: IndicatorRow, column: Column) => cellsFor(row)[column.id];
@@ -124,6 +131,7 @@ export function MarketValuationPane({ focused, width, height }: PaneProps) {
124
131
  onSelect: setIndicatorId,
125
132
  reload: refresh,
126
133
  range: { value: range, options: RANGE_VIEW_OPTIONS, onChange: setRange, chartRange: true },
134
+ shareItem: indicatorShareItem,
127
135
  });
128
136
  const { selected } = list;
129
137
  const selectedView = selected?.view;
@@ -6,7 +6,7 @@ export const membersPlugin: GloomPlugin = {
6
6
  id: "members", name: "Index and ETF members", version: "1.0.0", description: "ETF holdings, member returns, contributions, breadth and index changes", toggleable: true,
7
7
  setup(ctx) { fundBreadthCache.attach(ctx.persistence); fundListCache.attach(ctx.persistence); fundMembersCache.attach(ctx.persistence); fundChangesCache.attach(ctx.persistence); },
8
8
  dispose() { fundBreadthCache.reset(); fundListCache.reset(); fundMembersCache.reset(); fundChangesCache.reset(); },
9
- panes: [{ id: "members", name: "Index and ETF members", icon: "M", get component(): typeof import("./pane").MembersPane { const { MembersPane } = require("./pane"); return MembersPane; }, tickerFollower: true,
9
+ panes: [{ id: "members", name: "Index and ETF members", icon: "M", get component(): typeof import("./pane").MembersPane { const { MembersPane } = require("./pane"); return MembersPane; }, shareItem: { ticker: true }, tickerFollower: true,
10
10
  defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 132, height: 32 }, tableExport: true,
11
11
  settings: { fields: [{ key: "tab", label: "View", type: "select", options: TABS }] } }],
12
12
  paneTemplates: [{ id: "members-pane", paneId: "members", label: "Index and ETF members", description: "ETF holdings, member returns, daily contributions, breadth and index changes.",
@@ -35,6 +35,7 @@ export const mnaModule: PluginModule = {
35
35
  // MA and DIST open this pane: DIST sets the tab param, MA a ticker.
36
36
  identitySettings: ["ticker"],
37
37
  defaultPosition: "right",
38
+ shareItem: { ticker: true },
38
39
  tickerFollower: true,
39
40
  instruments: ["equity"],
40
41
  defaultMode: "floating",
@@ -6,7 +6,7 @@ import type {
6
6
  } from "../../../types/plugin";
7
7
  import type { NewsArticle, NewsQuery } from "../../../news/types";
8
8
  import {
9
- coinNewsFallbackNotice,
9
+ newsFallbackNotice,
10
10
  mapCloudNewsArticle,
11
11
  readCloudNews,
12
12
  type CloudNewsRead,
@@ -102,7 +102,7 @@ function projectNewsHeadless(
102
102
  freshness: cloudNewsFreshness(realtime),
103
103
  // A coin pair no story is filed under shows the stories that mention the coin, and says so.
104
104
  ...(response.searchedFor && args.symbols[0]
105
- ? { notes: [coinNewsFallbackNotice(parsePublicTickerKey(args.symbols[0]).symbol, response.searchedFor)] }
105
+ ? { notes: [newsFallbackNotice(parsePublicTickerKey(args.symbols[0]).symbol, response.searchedFor)] }
106
106
  // A receipt's or foreign line's stories are its company's, read from the home line.
107
107
  : response.companyFrom ? { notes: companyDataNotes(readCompanyFrom(response.companyFrom)) } : {}),
108
108
  metadata: {
@@ -7,7 +7,7 @@ import { useCallback } from "react";
7
7
  import { useDebouncedPluginPaneState, usePluginPaneState } from "../../runtime";
8
8
  import { EmptyState, PaneStatusBody, QueryBar, usePaneNoticeFooter } from "../../../components";
9
9
  import { useCompanyDataFooter } from "../../../components/layout/pane/status-footer";
10
- import { coinNewsFallbackNotice } from "../../../sources/gloomberb-cloud/news";
10
+ import { newsFallbackNotice } from "../../../sources/gloomberb-cloud/news";
11
11
  import { newsMuteSettingsDef, newsMutesApplyToFeed, useNewsMuteFilter } from "./wire/mutes";
12
12
  import { newsListEmptyCopy } from "./wire/filter-articles";
13
13
  import { NEWS_LIST_SEARCH_PLACEHOLDER, useNewsListSearch, useNewsListSearchHint } from "./wire/news/list-search";
@@ -88,11 +88,11 @@ function TickerNewsView({ width, height, focused }: { width: number; height: num
88
88
  }, [markArticleRead, popOutArticle, readableArticle]);
89
89
 
90
90
  useNewsListSearchHint("ticker-news", focused && !detailOpen, search.focusSearch);
91
- // A coin pair no story is filed under lists the stories that mention the coin; the footer says so.
91
+ // A coin pair or a future no story is filed under lists the stories that mention the coin or the commodity; the footer says so.
92
92
  const searchedFor = loaded[0]?.searchedFor;
93
93
  usePaneNoticeFooter({
94
94
  registrationId: "ticker-news-notices",
95
- notices: searchedFor && instrument ? [coinNewsFallbackNotice(instrument.symbol, searchedFor)] : [],
95
+ notices: searchedFor && instrument ? [newsFallbackNotice(instrument.symbol, searchedFor)] : [],
96
96
  focused,
97
97
  });
98
98
  useNewsArticleFooter({
@@ -193,6 +193,7 @@ export const tickerNewsModule: PluginModule = {
193
193
  icon: "C",
194
194
  component: TickerNewsView,
195
195
  defaultPosition: "right",
196
+ shareItem: { open: true, ticker: true },
196
197
  tickerFollower: true,
197
198
  defaultMode: "floating",
198
199
  defaultFloatingSize: { width: 100, height: 32 },
@@ -67,11 +67,12 @@ let disposeBreakingNewsNotifications: (() => void) | null = null;
67
67
  const NEWS_REPORT_FRESHNESS: PaneDef["reportFreshness"] = { status: "not-a-feed", basis: "published stories" };
68
68
 
69
69
  const newsWirePanes: PluginModule["panes"] = [
70
- { id: "news-top", reportFreshness: NEWS_REPORT_FRESHNESS, name: "Top News", icon: "T", component: TopPane, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 90, height: 30 } },
70
+ { id: "news-top", reportFreshness: NEWS_REPORT_FRESHNESS, name: "Top News", icon: "T", shareItem: { open: true }, component: TopPane, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 90, height: 30 } },
71
71
  {
72
72
  id: "news-feed",
73
73
  name: "News Feed",
74
74
  icon: "N",
75
+ shareItem: { open: true },
75
76
  component: FeedPane,
76
77
  defaultPosition: "right",
77
78
  defaultMode: "floating",
@@ -83,6 +84,7 @@ const newsWirePanes: PluginModule["panes"] = [
83
84
  reportFreshness: NEWS_REPORT_FRESHNESS,
84
85
  name: TOPIC_NEWS_TITLE,
85
86
  icon: "S",
87
+ shareItem: { open: true, argument: true },
86
88
  component: IndustryPane,
87
89
  defaultPosition: "right",
88
90
  defaultMode: "floating",
@@ -95,6 +97,7 @@ const newsWirePanes: PluginModule["panes"] = [
95
97
  reportArgument: { kind: "free-text", placeholder: "story id", description: "The id of the story to open.", identifier: true },
96
98
  name: "Story",
97
99
  icon: "A",
100
+ shareItem: { open: true },
98
101
  component: NewsStoryPane,
99
102
  defaultPosition: "right",
100
103
  defaultMode: "floating",
@@ -105,6 +108,7 @@ const newsWirePanes: PluginModule["panes"] = [
105
108
  reportFreshness: NEWS_REPORT_FRESHNESS,
106
109
  name: "Breaking News",
107
110
  icon: "!",
111
+ shareItem: { open: true },
108
112
  component: BreakingPane,
109
113
  defaultPosition: "right",
110
114
  defaultMode: "floating",
@@ -18,6 +18,8 @@ import { logFailure } from "../../../../../utils/log-failure";
18
18
  import { mergeNewsArticle } from "../../../../../news/news-model";
19
19
  import { usePluginPaneState } from "../../../../runtime";
20
20
  import { formatNewsCategory } from "../categories";
21
+ import { shareItemExcerpt } from "../../../../../shares/item";
22
+ import { usePaneShareItem } from "../../../../../shares/pane-item";
21
23
 
22
24
  function hasStoryItems(article: MarketNewsItem | null): boolean {
23
25
  return (article?.items?.length ?? 0) > 0;
@@ -233,6 +235,8 @@ export function NewsDetailView({ item, focused, width, showTitle = true }: {
233
235
  showTitle?: boolean;
234
236
  }) {
235
237
  const { nativePaneChrome } = useUiCapabilities();
238
+ // The story is what a link to the pane is about: its headline and summary.
239
+ usePaneShareItem(() => ({ title: item.title, excerpt: shareItemExcerpt(item.summary) }));
236
240
  const tickers = useMemo(
237
241
  () => collectNewsDisplayTickers(item.tickers),
238
242
  [item.tickers],
@@ -3,8 +3,11 @@ import { usePaneFooter, useQueryBarSearch } from "../../../../../components";
3
3
  import type { NewsArticle } from "../../../../../news/types";
4
4
  import { filterNewsArticles } from "../filter-articles";
5
5
 
6
- /** Only what the list has loaded is filtered; older stories load as the list scrolls. */
7
- export const NEWS_LIST_SEARCH_PLACEHOLDER = "filter loaded stories";
6
+ /**
7
+ * Only what the list has loaded is filtered; older stories load as the list scrolls. A narrow pane's field shows
8
+ * the short form whole rather than "filter loaded st".
9
+ */
10
+ export const NEWS_LIST_SEARCH_PLACEHOLDER = ["filter loaded stories", "filter stories"] as const;
8
11
 
9
12
  export function useNewsListSearch<T extends NewsArticle>(articles: readonly T[]) {
10
13
  const [searchQuery, setSearchQuery] = useState("");
@@ -99,6 +99,7 @@ export const optionsModule: PluginModule = {
99
99
  icon: "O",
100
100
  component: OptionsPane,
101
101
  defaultPosition: "right",
102
+ shareItem: { ticker: true },
102
103
  tickerFollower: true,
103
104
  // An option the person holds shows their position.
104
105
  personalData: (context) => (holdsActiveTicker(context) ? "holdings" : null),
@@ -46,6 +46,7 @@ export const optionsPositioningModule: PluginModule = {
46
46
  icon: "O",
47
47
  get component(): typeof import("./pane").OptionsPositioningPane { const { OptionsPositioningPane } = require("./pane"); return OptionsPositioningPane; },
48
48
  defaultPosition: "right",
49
+ shareItem: { ticker: true },
49
50
  tickerFollower: true,
50
51
  defaultMode: "floating",
51
52
  defaultFloatingSize: { width: 104, height: 34 },
@@ -6,7 +6,7 @@ import { LOOKBACK_OPTIONS, PeBandPane } from "./pane";
6
6
  export const peBandModule: PluginModule = {
7
7
  panes: [{
8
8
  id: "pe-band", name: "P/E Band", icon: "P", component: PeBandPane,
9
- defaultPosition: "right", tickerFollower: true, instruments: ["equity"], defaultMode: "floating", defaultFloatingSize: { width: 90, height: 30 },
9
+ defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, instruments: ["equity"], defaultMode: "floating", defaultFloatingSize: { width: 90, height: 30 },
10
10
  tableExport: true,
11
11
  settings: { title: "P/E Band Settings", fields: [
12
12
  { key: "lookbackYears", label: "Lookback", type: "select", options: LOOKBACK_OPTIONS },
@@ -52,8 +52,11 @@ const COLUMNS: readonly Column[] = [
52
52
  { id: "oi", label: "OI USD", width: 7, align: "right" },
53
53
  { id: "volume", label: "Vol 24h", width: 7, align: "right" },
54
54
  ];
55
- /** What a narrow overview gives up first: the volume, then the contract, then the premium. */
56
- const DROP_ORDER: readonly Column["id"][] = ["volume", "contract", "premium"];
55
+ /**
56
+ * What a narrow overview gives up first: the volume, then the contract, the premium, the open interest and the
57
+ * funding, so the columns left fit whole rather than squeezed into cut figures ("+0." for +0.0050%).
58
+ */
59
+ const DROP_ORDER: readonly Column["id"][] = ["volume", "contract", "premium", "oi", "funding"];
57
60
  const GAP = 2;
58
61
  const span = (columns: readonly Column[]) => columns.reduce((sum, column) => sum + column.width, 0) + GAP * (columns.length - 1);
59
62
 
@@ -252,22 +252,22 @@ function EntryDetail({ entry, width, host, status, failure }: {
252
252
  ) : null}
253
253
 
254
254
  <Box paddingTop={1} flexDirection="column">
255
- {contributes.length > 0 ? <KeyValueRow labelWidth={10} width={rowWidth} emphasis={false} label="Adds" value={contributes.join(", ")} /> : null}
256
- {opensWith.length > 0 ? <KeyValueRow labelWidth={10} width={rowWidth} emphasis={false} label="Opens with" value={opensWith.join(", ")} /> : null}
255
+ {contributes.length > 0 ? <KeyValueRow labelWidth={11} width={rowWidth} emphasis={false} label="Adds" value={contributes.join(", ")} /> : null}
256
+ {opensWith.length > 0 ? <KeyValueRow labelWidth={11} width={rowWidth} emphasis={false} label="Opens with" value={opensWith.join(", ")} /> : null}
257
257
  {/*
258
258
  * Declared by the plugin author and not enforced: plugins are not
259
259
  * sandboxed, so this is a hint about intent, not a limit. Labelled
260
260
  * "Declares" rather than "Network" so it does not read as a guarantee.
261
261
  */}
262
- {entry.hosts.length > 0 ? <KeyValueRow labelWidth={10} width={rowWidth} emphasis={false} label="Declares" value={entry.hosts.join(", ")} /> : null}
263
- {entry.repo ? <KeyValueRow labelWidth={10} width={rowWidth} emphasis={false} label="Source" value={`github.com/${entry.repo}`} /> : null}
264
- {entry.minGloomberb ? <KeyValueRow labelWidth={10} width={rowWidth} emphasis={false} label="Requires" value={requiredGloomberb(entry.minGloomberb) ? `Gloom ${entry.minGloomberb}, this is ${VERSION}` : `Gloom ${entry.minGloomberb}`} /> : null}
265
- {entry.linked ? <KeyValueRow labelWidth={10} width={rowWidth} emphasis={false} label="Linked" value={entry.directory ?? "local checkout"} /> : null}
266
- {entry.installedCommit ? <KeyValueRow labelWidth={10} width={rowWidth} emphasis={false} label="Commit" value={entry.installedCommit.slice(0, 7)} /> : null}
267
- {!entry.installed && entry.availableCommit ? <KeyValueRow labelWidth={10} width={rowWidth} emphasis={false} label="Pinned" value={`${entry.availableVersion ?? ""} ${entry.availableCommit.slice(0, 7)}`.trim()} /> : null}
268
- {entry.needsSetup ? <KeyValueRow labelWidth={10} width={rowWidth} emphasis={false} label="Setup" value="Missing a required setting. Press s." /> : null}
269
- {entry.loadError ? <KeyValueRow labelWidth={10} width={rowWidth} emphasis={false} label="Error" value={entry.loadError} /> : null}
270
- {entry.lastError && !entry.loadError ? <KeyValueRow labelWidth={10} width={rowWidth} emphasis={false} label="Last error" value={entry.lastError} /> : null}
262
+ {entry.hosts.length > 0 ? <KeyValueRow labelWidth={11} width={rowWidth} emphasis={false} label="Declares" value={entry.hosts.join(", ")} /> : null}
263
+ {entry.repo ? <KeyValueRow labelWidth={11} width={rowWidth} emphasis={false} label="Source" value={`github.com/${entry.repo}`} /> : null}
264
+ {entry.minGloomberb ? <KeyValueRow labelWidth={11} width={rowWidth} emphasis={false} label="Requires" value={requiredGloomberb(entry.minGloomberb) ? `Gloom ${entry.minGloomberb}, this is ${VERSION}` : `Gloom ${entry.minGloomberb}`} /> : null}
265
+ {entry.linked ? <KeyValueRow labelWidth={11} width={rowWidth} emphasis={false} label="Linked" value={entry.directory ?? "local checkout"} /> : null}
266
+ {entry.installedCommit ? <KeyValueRow labelWidth={11} width={rowWidth} emphasis={false} label="Commit" value={entry.installedCommit.slice(0, 7)} /> : null}
267
+ {!entry.installed && entry.availableCommit ? <KeyValueRow labelWidth={11} width={rowWidth} emphasis={false} label="Pinned" value={`${entry.availableVersion ?? ""} ${entry.availableCommit.slice(0, 7)}`.trim()} /> : null}
268
+ {entry.needsSetup ? <KeyValueRow labelWidth={11} width={rowWidth} emphasis={false} label="Setup" value="Missing a required setting. Press s." /> : null}
269
+ {entry.loadError ? <KeyValueRow labelWidth={11} width={rowWidth} emphasis={false} label="Error" value={entry.loadError} /> : null}
270
+ {entry.lastError && !entry.loadError ? <KeyValueRow labelWidth={11} width={rowWidth} emphasis={false} label="Last error" value={entry.lastError} /> : null}
271
271
  </Box>
272
272
 
273
273
  {!entry.installed && !entry.bundled && entry.repo ? (
@@ -406,6 +406,10 @@ async function setPositionCommand(
406
406
  }
407
407
  await store.saveTicker(result.ticker);
408
408
  if (adopted) await saveConfig(adopted);
409
+ // Said, never silent: a book named "LatAm Book USD" otherwise totals in BRL from its first PETR4 lot on.
410
+ const currencyNote = adopted && portfolioCurrency !== portfolio.currency
411
+ ? firstPositionCurrencyNote(portfolio, portfolioCurrency) : null;
412
+ if (currencyNote?.warning) notes.push(currencyNote.text);
409
413
  const saved = savedListingName(result.ticker);
410
414
  const quantity = formatMarketQuantity(shares, { assetCategory: result.ticker.metadata.assetCategory });
411
415
  // A cost in another currency converts at the rate it was bought at when the lot has one, else at the close of the
@@ -426,6 +430,7 @@ async function setPositionCommand(
426
430
  ...(future ? { contractMultiplier: multiplier ?? null, contractSize: size?.size ?? null } : {}),
427
431
  ...(purchaseDate ? { dateAcquired: purchaseDate } : {}),
428
432
  ...(foreign ? { costFxRate: boughtRate, costFxCurrency: portfolioCurrency, costFxDate: rateDate } : {}),
433
+ ...(currencyNote ? { totalsCurrency: portfolioCurrency } : {}),
429
434
  },
430
435
  warnings: notes.length > 0 ? notes : undefined,
431
436
  }, {
@@ -447,6 +452,7 @@ async function setPositionCommand(
447
452
  ? `Cost converted at today's rate into ${portfolioCurrency}: the FX close of the purchase date could not be read.`
448
453
  : `Cost converted at today's rate into ${portfolioCurrency}; add --date or --cost-fx to use the rate when bought.`)]
449
454
  : []),
455
+ ...(currencyNote && !currencyNote.warning ? [cliStyles.muted(currencyNote.text)] : []),
450
456
  ].join("\n"),
451
457
  });
452
458
  } catch (error) {
@@ -455,6 +461,25 @@ async function setPositionCommand(
455
461
  });
456
462
  }
457
463
 
464
+ /**
465
+ * What the first position of a book that follows its holdings' currency says
466
+ * when it moves the book off the one it had: a line, `"LatAm Book USD" now
467
+ * totals in BRL, its first position's currency.`, and a warning only when
468
+ * the book holds cash or targets already, which were set beside its old
469
+ * totals: `..., its cash and targets included. To keep USD, recreate it with
470
+ * --currency USD.`
471
+ */
472
+ function firstPositionCurrencyNote(portfolio: Portfolio, adopted: string): { text: string; warning: boolean } {
473
+ const note = `"${portfolio.name}" now totals in ${adopted}, its first position's currency`;
474
+ const held = [
475
+ portfolio.cash && portfolio.cash.amount !== 0 ? "cash" : null,
476
+ Object.keys(portfolio.targetWeights ?? {}).length > 0 ? "targets" : null,
477
+ ].filter((part): part is string => part !== null);
478
+ if (held.length === 0) return { text: `${note}.`, warning: false };
479
+ const was = portfolio.currency;
480
+ return { text: `${note}, its ${held.join(" and ")} included. To keep ${was}, recreate it with --currency ${was}.`, warning: true };
481
+ }
482
+
458
483
  /**
459
484
  * Sets the position, saying how to go on when the lots it replaces were
460
485
  * bought at FX rates one position cannot keep: give the whole position's rate.
@@ -32,7 +32,7 @@ import { valuationBasisLabel, type PortfolioValuationBasis } from "../../../port
32
32
  import { futuresQuantityText, isFuturesTicker } from "../../../portfolio/futures-positions";
33
33
  import { dailyFuturesHistory, loadPortfolioFuturesTerms } from "../../../portfolio/futures-terms";
34
34
  import { loadPurchaseDateCostFx } from "../../../portfolio/cost-fx";
35
- import { EXTENDED_SESSION_LABELS, quoteHeadlineTime, type ExtendedSession } from "../../../market-data/market/status";
35
+ import { EXTENDED_SESSION_LABELS, getCompletedRegularSessionDisplay, quoteHeadlineTime, type ExtendedSession } from "../../../market-data/market/status";
36
36
  import {
37
37
  BROKER_ACCOUNT_MISSING_NOTE,
38
38
  CASH_SYMBOL,
@@ -53,6 +53,13 @@ import { REPORT_ROWS } from "../shared/headless-options";
53
53
  import { readPriceWindow, type PriceWindow } from "../../../utils/price-window";
54
54
  import { loadPeriodPnl, periodBasisText, periodBoughtText, periodUnpricedText } from "./period-pnl";
55
55
 
56
+ /** An extended print without a known regular close cannot supply a regular-session change. */
57
+ function regularChangeFields(quote: Quote | undefined, change: unknown) {
58
+ const known = quote && (!quote.marketState || quote.marketState === "REGULAR" || getCompletedRegularSessionDisplay(quote));
59
+ const value = known && typeof change === "number" && Number.isFinite(change) ? change : null;
60
+ return { changePercent: value, changeBasis: value == null ? null : "regular-session" };
61
+ }
62
+
56
63
  const DEFAULT_ROW_LIMIT = 50;
57
64
  const MAX_ROW_LIMIT = 200;
58
65
 
@@ -94,7 +101,7 @@ const POSITION_COLUMNS: HeadlessPaneColumn[] = [
94
101
  { key: "avgCost", header: "Avg Cost", align: "right", format: unitMoney("positionCurrency"), description: "Per unit, in the position's currency." },
95
102
  { key: "price", header: "Last", align: "right", format: unitMoney("priceCurrency"), description: "In the quote's currency." },
96
103
  { key: "priceCurrency", header: "Ccy" },
97
- { key: "changePercent", header: "Chg", align: "right", format: percent },
104
+ { key: "changePercent", header: "Regular %", align: "right", format: percent },
98
105
  { key: "marketValue", header: "Mkt Val", align: "right", format: wholeAmount, description: "In the portfolio's currency; negative for shorts." },
99
106
  { key: "unrealizedPnl", header: "P&L", align: "right", format: amount, description: "Unrealized, in the portfolio's currency." },
100
107
  { key: "weight", header: "Weight", align: "right", format: weight, description: "Percent of the total value, cash included; unpriced holdings are left out." },
@@ -147,7 +154,7 @@ const WATCHLIST_COLUMNS: HeadlessPaneColumn[] = [
147
154
  { key: "exchange", header: "Exchange" },
148
155
  { key: "price", header: "Last", align: "right" },
149
156
  { key: "priceCurrency", header: "Ccy" },
150
- { key: "changePercent", header: "Chg", align: "right", format: percent },
157
+ { key: "changePercent", header: "Regular %", align: "right", format: percent },
151
158
  ];
152
159
 
153
160
  /**
@@ -359,7 +366,8 @@ async function portfolioHoldings(
359
366
  // Last and Chg are the regular session; market value and P&L are at `valuationPrice`.
360
367
  price: finite(row.quotePrice),
361
368
  priceCurrency: row.quoteCurrency ?? null,
362
- changePercent: finite(headline?.changePercent),
369
+ ...regularChangeFields(quotes.get(ticker.metadata.ticker), headline?.changePercent),
370
+ extendedChangeBasis: extended ? "from-regular-close" : null,
363
371
  ...extendedQuoteFields(extended),
364
372
  marketValue,
365
373
  unrealizedPnl: finite(row.unrealizedPnl),
@@ -467,7 +475,7 @@ const PERIOD_COLUMNS: HeadlessPaneColumn[] = [
467
475
  { key: "shares", header: "Qty", align: "right", format: quantity },
468
476
  { key: "startPrice", header: "Start", align: "right", format: unitMoney("priceCurrency"), description: "The close before the window, in the quote's currency." },
469
477
  { key: "endPrice", header: "End", align: "right", format: unitMoney("priceCurrency"), description: "The last close in the window, in the quote's currency." },
470
- { key: "changePercent", header: "Chg", align: "right", format: percent },
478
+ { key: "changePercent", header: "Period %", align: "right", format: percent },
471
479
  { key: "pnl", header: "P&L", align: "right", format: amount, description: "The price move times the units held now, in the portfolio's currency at the end's rate." },
472
480
  { key: "contribution", header: "Contribution", align: "right", format: percent, description: "P&L over the book's value at the start, gross when it holds a short, in percent." },
473
481
  ];
@@ -584,7 +592,8 @@ async function watchlistHoldings(
584
592
  exchange: ticker.metadata.exchange || null,
585
593
  price: finite(headline?.price ?? quote?.price),
586
594
  priceCurrency: quote?.currency ?? null,
587
- changePercent: finite(headline ? headline.changePercent : quote?.changePercent),
595
+ ...regularChangeFields(quote, headline ? headline.changePercent : quote?.changePercent),
596
+ extendedChangeBasis: extended ? "from-regular-close" : null,
588
597
  ...extendedQuoteFields(extended),
589
598
  };
590
599
  });
@@ -528,7 +528,9 @@ export function renderSummarySegments(segments: PortfolioSummarySegment[], width
528
528
  <Box key={segment.id} flexDirection="row">
529
529
  {segmentIndex > 0 && <Text fg={colors.textDim}>{" "}</Text>}
530
530
  {segment.parts.map((part, partIndex) => (
531
- <Box key={`${segment.id}:${partIndex}`} flexDirection="row">
531
+ // A row too narrow for its segment cuts the muted basis ("vs Thu 5 Nov close"), never the
532
+ // label or the figure: "Avg +1." read as a different number than +1.02%.
533
+ <Box key={`${segment.id}:${partIndex}`} flexDirection="row" flexShrink={part.tone === "muted" ? 1 : 0}>
532
534
  {partIndex > 0 && <Text fg={colors.textDim}>{" "}</Text>}
533
535
  <Text
534
536
  fg={part.color ?? (part.tone === "label" || part.tone === "muted" ? colors.textDim : colors.text)}
@@ -14,7 +14,7 @@ const CACHES = [powerBoardCache, powerHistoryCache, powerDetailCache, powerPrice
14
14
  export const powerModule: PluginModule = {
15
15
  series: [...DAY_AHEAD_SERIES, ...CARBON_SERIES, ...GAS_STORAGE_SERIES],
16
16
  // POWER sets the symbol param, EPWR the prices tab.
17
- panes: [{ id: "power", name: "Power & Grid", icon: "P", get component(): typeof import("./pane").PowerPane { const { PowerPane } = require("./pane"); return PowerPane; }, defaultPosition: "right", defaultMode: "floating", identitySettings: ["tab", "symbol"],
17
+ panes: [{ id: "power", name: "Power & Grid", icon: "P", shareItem: { argument: true }, get component(): typeof import("./pane").PowerPane { const { PowerPane } = require("./pane"); return PowerPane; }, defaultPosition: "right", defaultMode: "floating", identitySettings: ["tab", "symbol"],
18
18
  defaultFloatingSize: { width: 132, height: 34 }, tableExport: true, headless: powerHeadless }],
19
19
  paneTemplates: [{ id: "power-pane", paneId: "power", label: "Power & Grid",
20
20
  description: "Pro: interconnection queues, historical MW and outcomes, datacenter loads, utility exposure and generation capacity, with primary evidence.",
@@ -6,7 +6,7 @@ import { ESTIMATOR_OPTIONS, WINDOW_OPTIONS } from "./settings";
6
6
  export const realizedVolModule: PluginModule = {
7
7
  panes: [{
8
8
  id: "realized-vol", name: "Realized Volatility", icon: "V", get component(): typeof import("./pane").RealizedVolPane { const { RealizedVolPane } = require("./pane"); return RealizedVolPane; },
9
- defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 112, height: 36 },
9
+ defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 112, height: 36 },
10
10
  tableExport: true,
11
11
  quickSettings: [{ type: "toggle", key: "showIv", icon: "zap", label: "Current ATM IV" }],
12
12
  settings: { title: "Realized Volatility Settings", fields: [
@@ -69,6 +69,8 @@ export interface EventRow {
69
69
  /** Keep the supplied ranges and comparison inputs available in detail/export. */
70
70
  estimateInputs?: { eps?: AnalystEstimateRecord; revenue?: AnalystEstimateRecord };
71
71
  estimateGrowthMetric?: "eps" | "revenue";
72
+ /** An estimate row's growth over the year-ago figure, as a fraction, of `estimateGrowthMetric`. */
73
+ estimateGrowth?: number;
72
74
  fiscalPeriodEnd?: string;
73
75
  periodDateSource?: FinancialStatement["dateSource"];
74
76
  providerPeriodDate?: string;
@@ -341,6 +343,10 @@ export function buildEventRows(
341
343
  // quarters give it when they all agree on one.
342
344
  const feedCurrencies = new Set(earnings.map((earning) => earning.currency).filter(Boolean));
343
345
  const feedCurrency = feedCurrencies.size === 1 ? [...feedCurrencies][0] : undefined;
346
+ // So do the oldest reported quarters (before 2024), which the feed leaves unlabelled, but only where the
347
+ // company's own EPS is in that currency too: one company's EPS then reads in one unit down the table, and an
348
+ // unlabelled figure nothing else vouches for stays unlabelled.
349
+ const reportedCurrency = feedCurrency && fundamentalsEpsCurrency(financials) === feedCurrency ? feedCurrency : undefined;
344
350
  for (const [index, earning] of earnings.entries()) {
345
351
  // A pending announcement must never inherit the previous report's actuals.
346
352
  const statement = earning.epsActual == null ? undefined : statementForEarningsDate(quarterlyStatements, earning);
@@ -357,7 +363,7 @@ export function buildEventRows(
357
363
  period: statement ? quarterLabel(statement.date) : earning.fiscalPeriod ? quarterLabel(earning.fiscalPeriod) : "-",
358
364
  ...(earning.time?.trim() ? { reportTime: earning.time.trim() } : {}),
359
365
  detail: upcomingEarningsDetail(earning),
360
- epsCurrency: earning.currency ?? (earning.epsActual == null ? feedCurrency : undefined),
366
+ epsCurrency: earning.currency ?? (earning.epsActual == null ? feedCurrency : reportedCurrency),
361
367
  revenueCurrency: statement ? statement.currency ?? financials?.financialCurrency : undefined,
362
368
  qEps: earning.epsActual ?? earning.epsEstimate,
363
369
  qRevenue: statement?.totalRevenue,
@@ -386,6 +392,7 @@ export function buildEventRows(
386
392
  for (const pair of buildEstimatePairs(estimates)) {
387
393
  const isFiscal = isFiscalEstimatePeriod(pair.period);
388
394
  if (!isFiscal && isReportedQuarter(pair.date, reportedPeriodEnds)) continue;
395
+ const growth = pair.eps?.growth ?? pair.revenue?.growth;
389
396
  rows.push({
390
397
  id: `estimate:${pair.date}:${pair.period}`,
391
398
  date: pair.date,
@@ -399,6 +406,7 @@ export function buildEventRows(
399
406
  ...(pair.revenue ? { revenue: { ...pair.revenue } } : {}),
400
407
  },
401
408
  estimateGrowthMetric: pair.eps?.growth != null ? "eps" : pair.revenue?.growth != null ? "revenue" : undefined,
409
+ ...growth != null ? { estimateGrowth: growth } : {},
402
410
  epsCurrency: pair.eps?.currency,
403
411
  revenueCurrency: pair.revenue?.currency,
404
412
  qEps: isFiscal ? undefined : pair.eps?.average,