@gloom-sh/terminal 0.20.4 → 0.20.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/README.md +3 -1
  2. package/README.zh-CN.md +1 -1
  3. package/bin/gloom +9 -0
  4. package/bin/without-bun.cjs +98 -0
  5. package/package.json +4 -1
  6. package/src/api-client/data.ts +148 -37
  7. package/src/api-client/hk-tenders.ts +59 -0
  8. package/src/api-client/index.ts +1 -0
  9. package/src/api-client/types/econ.ts +30 -0
  10. package/src/api-client/yield-curves.ts +1 -1
  11. package/src/app/global-shortcuts.ts +4 -1
  12. package/src/app/keybindings/actions.ts +6 -0
  13. package/src/app/keybindings/config.ts +2 -1
  14. package/src/app/keybindings/index.ts +1 -0
  15. package/src/app/keybindings/labels.ts +6 -1
  16. package/src/app/keybindings/resolve.ts +23 -4
  17. package/src/app/keybindings/terminal-keys.ts +35 -0
  18. package/src/app/pane-runtime/index.tsx +2 -2
  19. package/src/app/pane-runtime/ticker-open-runtime.ts +68 -40
  20. package/src/app.tsx +18 -13
  21. package/src/architecture/floating-promise-allowlist.json +313 -0
  22. package/src/architecture/ui-literals-allowlist.json +1 -1
  23. package/src/capabilities/chart-series.ts +27 -1
  24. package/src/cli/commands/keybindings.ts +5 -5
  25. package/src/cli/commands/market.ts +238 -57
  26. package/src/cli/commands/news-search.ts +81 -14
  27. package/src/cli/commands/overview.ts +27 -6
  28. package/src/cli/commands/remote.ts +16 -17
  29. package/src/cli/commands/system.ts +1 -1
  30. package/src/cli/commands/ticker.ts +3 -1
  31. package/src/cli/early-command.ts +2 -0
  32. package/src/cli/errors.ts +10 -1
  33. package/src/cli/fx-forward.ts +89 -7
  34. package/src/cli/fx-pair.ts +1 -1
  35. package/src/cli/fx-quote-rate.ts +23 -0
  36. package/src/cli/glossary.ts +19 -5
  37. package/src/cli/help.ts +1 -0
  38. package/src/cli/history-rows.ts +5 -3
  39. package/src/cli/index-roots.ts +5 -4
  40. package/src/cli/index.ts +40 -3
  41. package/src/cli/known-gaps.ts +38 -9
  42. package/src/cli/listing-arg.ts +17 -5
  43. package/src/cli/name-entries.ts +5 -1
  44. package/src/cli/not-a-ticker.ts +4 -0
  45. package/src/cli/options.ts +52 -3
  46. package/src/cli/output-file.ts +5 -3
  47. package/src/cli/pane-functions/catalog.ts +15 -0
  48. package/src/cli/pane-functions/function-help.ts +4 -4
  49. package/src/cli/pane-functions/headless.ts +9 -4
  50. package/src/cli/pane-functions/index.ts +6 -4
  51. package/src/cli/pane-functions/resolver.ts +2 -2
  52. package/src/cli/result.ts +21 -2
  53. package/src/cli/spreadsheet-hint.ts +7 -3
  54. package/src/cli/treasury-yields.ts +5 -3
  55. package/src/components/chart/composite/legend.tsx +40 -2
  56. package/src/components/command-bar/pane-settings.ts +2 -2
  57. package/src/components/command-bar/routes/root/results.ts +6 -2
  58. package/src/components/command-bar/workflow/tickers.ts +2 -2
  59. package/src/components/data-table/view.tsx +9 -2
  60. package/src/components/input-search-bar.tsx +9 -2
  61. package/src/components/layout/pane/header.tsx +2 -0
  62. package/src/components/layout/shell/pane/capture.ts +4 -1
  63. package/src/components/layout/status-bar.tsx +6 -1
  64. package/src/components/onboarding/first-run-workspace.ts +44 -2
  65. package/src/components/onboarding/onboarding-frame.tsx +11 -2
  66. package/src/components/onboarding/onboarding-keyboard.ts +16 -0
  67. package/src/components/onboarding/onboarding-wizard.tsx +8 -8
  68. package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
  69. package/src/components/onboarding/use-onboarding-progress.ts +12 -4
  70. package/src/components/pane-settings-dialog/desktop.tsx +2 -2
  71. package/src/components/pane-settings-dialog/tui.tsx +2 -2
  72. package/src/components/pane-settings-dialog/value.ts +6 -0
  73. package/src/components/pane-settings-dialog.tsx +3 -3
  74. package/src/components/reader/detail-reader.tsx +4 -0
  75. package/src/components/ui/data-table/opentui/index.tsx +11 -4
  76. package/src/components/ui/data-table/opentui/model.ts +8 -6
  77. package/src/components/ui/data-table/types.ts +6 -1
  78. package/src/components/ui/index.ts +1 -1
  79. package/src/components/ui/page-stack-view.tsx +3 -0
  80. package/src/components/ui/pane-link-chip.tsx +269 -54
  81. package/src/components/ui/query-bar.tsx +2 -1
  82. package/src/components/ui/table-layout.ts +38 -1
  83. package/src/components/ui/tabs.tsx +97 -19
  84. package/src/core/state/app/layout-reducer.ts +7 -0
  85. package/src/core/state/app/layout.ts +44 -7
  86. package/src/core/state/app/state.ts +1 -1
  87. package/src/core/state/app/types.ts +22 -2
  88. package/src/docs/snapshot.json +30 -13
  89. package/src/market-data/depositary-pair.ts +5 -3
  90. package/src/market-data/market/change-basis.ts +9 -5
  91. package/src/market-data/market/dated-previous-close.ts +147 -17
  92. package/src/market-data/market/status.ts +17 -1
  93. package/src/market-data/quotes/contributions.ts +2 -0
  94. package/src/market-data/quotes/listing-enterprise-value.ts +50 -0
  95. package/src/plugins/builtin/alerts/metric-data.ts +15 -2
  96. package/src/plugins/builtin/analytics/risk-client.ts +10 -4
  97. package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
  98. package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
  99. package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
  100. package/src/plugins/builtin/awards/index.tsx +1 -1
  101. package/src/plugins/builtin/backtest/headless.ts +1 -1
  102. package/src/plugins/builtin/buildout/index.tsx +1 -0
  103. package/src/plugins/builtin/catalysts/index.tsx +2 -2
  104. package/src/plugins/builtin/cds/headless.ts +4 -0
  105. package/src/plugins/builtin/cds/model.ts +0 -6
  106. package/src/plugins/builtin/chart-composer/formula.ts +16 -3
  107. package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -0
  108. package/src/plugins/builtin/chart-composer/headless.ts +4 -2
  109. package/src/plugins/builtin/chart-composer/index.tsx +1 -0
  110. package/src/plugins/builtin/chart-composer/presets.ts +1 -0
  111. package/src/plugins/builtin/chat/content/composer.tsx +5 -4
  112. package/src/plugins/builtin/chat/content/index.tsx +12 -2
  113. package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
  114. package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
  115. package/src/plugins/builtin/chat/layout.ts +5 -2
  116. package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
  117. package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
  118. package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
  119. package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
  120. package/src/plugins/builtin/cloud/askg/pane.tsx +55 -13
  121. package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
  122. package/src/plugins/builtin/cloud/terminal-relay/redact.ts +5 -3
  123. package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
  124. package/src/plugins/builtin/company-attention/index.tsx +1 -1
  125. package/src/plugins/builtin/company-kpis/headless.ts +3 -1
  126. package/src/plugins/builtin/company-kpis/index.tsx +2 -2
  127. package/src/plugins/builtin/cot/index.tsx +1 -1
  128. package/src/plugins/builtin/cpi/index.tsx +1 -1
  129. package/src/plugins/builtin/credit-boards/cdx-pane.tsx +20 -7
  130. package/src/plugins/builtin/credit-boards/client.ts +8 -0
  131. package/src/plugins/builtin/credit-boards/headless.ts +4 -1
  132. package/src/plugins/builtin/credit-boards/model.ts +58 -4
  133. package/src/plugins/builtin/credit-boards/series.ts +63 -6
  134. package/src/plugins/builtin/credit-boards/sovr-pane.tsx +3 -2
  135. package/src/plugins/builtin/credit-conditions/headless.ts +24 -6
  136. package/src/plugins/builtin/credit-conditions/index.tsx +1 -1
  137. package/src/plugins/builtin/credit-conditions/model.ts +12 -6
  138. package/src/plugins/builtin/credit-conditions/series.ts +2 -1
  139. package/src/plugins/builtin/crypto-board/index.tsx +1 -0
  140. package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
  141. package/src/plugins/builtin/doe/index.tsx +1 -1
  142. package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
  143. package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
  144. package/src/plugins/builtin/econ/calendar-model.ts +115 -8
  145. package/src/plugins/builtin/econ/calendar-source.ts +7 -1
  146. package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
  147. package/src/plugins/builtin/econ/index.tsx +42 -8
  148. package/src/plugins/builtin/econ/types.ts +3 -0
  149. package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
  150. package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
  151. package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
  152. package/src/plugins/builtin/executives/index.tsx +1 -0
  153. package/src/plugins/builtin/filing-events/index.tsx +1 -0
  154. package/src/plugins/builtin/fixed-income/index.tsx +3 -0
  155. package/src/plugins/builtin/futures-curve/headless.ts +3 -3
  156. package/src/plugins/builtin/futures-curve/index.tsx +1 -1
  157. package/src/plugins/builtin/futures-curve/model.ts +18 -0
  158. package/src/plugins/builtin/fx-matrix/index.tsx +44 -14
  159. package/src/plugins/builtin/gpu/index.tsx +1 -1
  160. package/src/plugins/builtin/help/functions-table.tsx +1 -1
  161. package/src/plugins/builtin/help/index.tsx +11 -1
  162. package/src/plugins/builtin/help/keybindings-editor.tsx +7 -3
  163. package/src/plugins/builtin/holders/index.tsx +1 -0
  164. package/src/plugins/builtin/holders/report-header.ts +2 -2
  165. package/src/plugins/builtin/insider/index.tsx +1 -0
  166. package/src/plugins/builtin/iv-history/index.tsx +1 -1
  167. package/src/plugins/builtin/jobs/index.tsx +1 -0
  168. package/src/plugins/builtin/macro-day/headless.ts +27 -8
  169. package/src/plugins/builtin/macro-day/index.tsx +1 -1
  170. package/src/plugins/builtin/macro-day/model.ts +19 -3
  171. package/src/plugins/builtin/macro-day/pane.tsx +14 -9
  172. package/src/plugins/builtin/macro-day/releases.ts +25 -7
  173. package/src/plugins/builtin/market-valuation/index.tsx +1 -0
  174. package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
  175. package/src/plugins/builtin/members/index.tsx +1 -1
  176. package/src/plugins/builtin/mna/index.tsx +1 -0
  177. package/src/plugins/builtin/news/index.tsx +1 -0
  178. package/src/plugins/builtin/news/wire/index.tsx +5 -1
  179. package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
  180. package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
  181. package/src/plugins/builtin/options/index.tsx +1 -0
  182. package/src/plugins/builtin/options-positioning/index.tsx +1 -0
  183. package/src/plugins/builtin/pe-band/index.tsx +1 -1
  184. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
  185. package/src/plugins/builtin/portfolio-list/cli/render.ts +20 -3
  186. package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +5 -1
  187. package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
  188. package/src/plugins/builtin/power/index.tsx +1 -1
  189. package/src/plugins/builtin/realized-vol/index.tsx +1 -1
  190. package/src/plugins/builtin/research/headless-schema.ts +4 -3
  191. package/src/plugins/builtin/research/headless.ts +10 -4
  192. package/src/plugins/builtin/research/index.tsx +4 -0
  193. package/src/plugins/builtin/research/relative-valuation-columns.ts +145 -47
  194. package/src/plugins/builtin/research/relative-valuation-currency.ts +31 -0
  195. package/src/plugins/builtin/research/relative-valuation-headless.ts +25 -8
  196. package/src/plugins/builtin/research/relative-valuation-model.ts +40 -9
  197. package/src/plugins/builtin/research/relative-valuation-pane.tsx +3 -2
  198. package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -2
  199. package/src/plugins/builtin/research-search/index.tsx +1 -0
  200. package/src/plugins/builtin/research-search/pane.tsx +8 -0
  201. package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
  202. package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
  203. package/src/plugins/builtin/risk-factors/index.tsx +1 -0
  204. package/src/plugins/builtin/scanner/headless.ts +52 -13
  205. package/src/plugins/builtin/seasonality/index.tsx +1 -1
  206. package/src/plugins/builtin/sec/index.tsx +1 -0
  207. package/src/plugins/builtin/series-inventory.ts +1 -1
  208. package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
  209. package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
  210. package/src/plugins/builtin/short-interest/index.tsx +1 -0
  211. package/src/plugins/builtin/social-mentions/index.tsx +1 -1
  212. package/src/plugins/builtin/supply-chain/index.tsx +1 -0
  213. package/src/plugins/builtin/thirteenf/api.ts +47 -4
  214. package/src/plugins/builtin/thirteenf/data.ts +43 -10
  215. package/src/plugins/builtin/thirteenf/headless.ts +55 -11
  216. package/src/plugins/builtin/thirteenf/model.ts +25 -9
  217. package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
  218. package/src/plugins/builtin/thirteenf/types.ts +2 -0
  219. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
  220. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +8 -7
  221. package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +8 -5
  222. package/src/plugins/builtin/ticker-detail/financials/model.ts +18 -2
  223. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
  224. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +6 -6
  225. package/src/plugins/builtin/ticker-detail/headless.ts +24 -17
  226. package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
  227. package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
  228. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +6 -4
  229. package/src/plugins/builtin/time-sales/client.ts +9 -11
  230. package/src/plugins/builtin/time-sales/index.tsx +1 -1
  231. package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
  232. package/src/plugins/builtin/treasury-auctions/cache.ts +54 -5
  233. package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
  234. package/src/plugins/builtin/treasury-auctions/headless.ts +150 -22
  235. package/src/plugins/builtin/treasury-auctions/hk-headless.ts +126 -0
  236. package/src/plugins/builtin/treasury-auctions/hk-view.tsx +347 -0
  237. package/src/plugins/builtin/treasury-auctions/hk.ts +363 -0
  238. package/src/plugins/builtin/treasury-auctions/index.tsx +27 -4
  239. package/src/plugins/builtin/treasury-auctions/model.ts +264 -28
  240. package/src/plugins/builtin/treasury-auctions/pane.tsx +176 -41
  241. package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
  242. package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
  243. package/src/plugins/builtin/vol-surface/index.tsx +1 -1
  244. package/src/plugins/builtin/world-venue-map/index.ts +1 -0
  245. package/src/plugins/builtin/yield-curve/curves.ts +10 -4
  246. package/src/plugins/builtin/yield-curve/headless.ts +6 -2
  247. package/src/plugins/builtin/yield-curve/index.tsx +3 -3
  248. package/src/plugins/builtin/yield-curve/series.ts +10 -0
  249. package/src/plugins/builtin/yield-curve/world.ts +3 -1
  250. package/src/portfolio/collection-name.ts +22 -0
  251. package/src/portfolio/column-values.ts +2 -1
  252. package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
  253. package/src/public/remote.ts +7 -1
  254. package/src/remote/client.ts +191 -11
  255. package/src/remote/controller-utils.ts +13 -1
  256. package/src/remote/controller.ts +88 -26
  257. package/src/remote/endpoint.ts +24 -0
  258. package/src/remote/form.ts +59 -4
  259. package/src/remote/resources.ts +44 -18
  260. package/src/remote/schema.ts +21 -9
  261. package/src/remote/secrets.ts +12 -0
  262. package/src/remote/semantic-tree.tsx +14 -2
  263. package/src/remote/server.ts +2 -1
  264. package/src/remote/surface.tsx +192 -0
  265. package/src/remote/types.ts +5 -0
  266. package/src/renderers/dom/data-table/frozen-column.ts +3 -1
  267. package/src/renderers/dom/data-table/index.tsx +27 -9
  268. package/src/renderers/dom/data-table/row.tsx +2 -0
  269. package/src/renderers/electrobun/bun/desktop/backend.ts +27 -24
  270. package/src/renderers/electrobun/bun/desktop/detached-windows.ts +3 -3
  271. package/src/renderers/electrobun/bun/desktop/snapshot-commit.ts +77 -0
  272. package/src/renderers/electrobun/shared/protocol.ts +4 -0
  273. package/src/renderers/electrobun/view/backend-rpc.ts +3 -0
  274. package/src/renderers/electrobun/view/desktop/window/bridge.ts +3 -0
  275. package/src/renderers/opentui/host.tsx +6 -0
  276. package/src/series/standalone.ts +2 -2
  277. package/src/shares/api.ts +21 -4
  278. package/src/shares/item.ts +73 -0
  279. package/src/shares/pane-item.ts +205 -0
  280. package/src/shares/pane.ts +4 -0
  281. package/src/shares/payload.ts +9 -5
  282. package/src/sources/gloomberb-cloud/news.ts +2 -0
  283. package/src/sources/gloomberb-cloud/normalizers.ts +9 -5
  284. package/src/sources/provider-router/cache.ts +3 -1
  285. package/src/sync/controller.ts +17 -2
  286. package/src/sync/other-window-tabs.ts +32 -1
  287. package/src/sync/react.ts +4 -4
  288. package/src/tickers/renamed-listings.ts +105 -0
  289. package/src/tickers/search/index.ts +103 -16
  290. package/src/time-series/bar-spacing.ts +33 -0
  291. package/src/time-series/base-series.ts +21 -3
  292. package/src/time-series/chart-bounds.ts +31 -0
  293. package/src/time-series/field-catalog.ts +17 -0
  294. package/src/time-series/fundamentals.ts +143 -11
  295. package/src/time-series/ice-credit.ts +32 -6
  296. package/src/time-series/resolve.ts +11 -7
  297. package/src/time-series/session-bar.ts +78 -9
  298. package/src/time-series/studies/formula.ts +53 -10
  299. package/src/time-series/studies/pair.ts +18 -7
  300. package/src/time-series/studies/units.ts +49 -2
  301. package/src/time-series/types.ts +12 -0
  302. package/src/types/desktop-window.ts +2 -0
  303. package/src/types/financials.ts +7 -0
  304. package/src/types/headless.ts +8 -0
  305. package/src/types/plugin-pane-settings.ts +2 -0
  306. package/src/types/plugin-panes.ts +22 -0
  307. package/src/utils/central-banks.ts +86 -1
  308. package/src/utils/cli-output.ts +6 -3
  309. package/src/utils/datetime-format.ts +12 -3
  310. package/src/utils/depositary-receipt.ts +28 -3
  311. package/src/utils/ebitda.ts +128 -0
  312. package/src/utils/format.ts +1 -1
  313. package/src/utils/fundamentals.ts +14 -0
  314. package/src/utils/max-drawdown.ts +97 -16
  315. package/src/utils/shell-word.ts +13 -0
  316. package/src/utils/untrusted-text.ts +29 -0
@@ -11,6 +11,7 @@ import {
11
11
  type PaneFooterSegment,
12
12
  } from "../../../components";
13
13
  import { handleRefreshKey } from "../../../components/data-table/table-pane";
14
+ import { getTableWidth } from "../../../components/ui/table-layout";
14
15
  import { createDataTableCsv } from "../../../components/data-table/export";
15
16
  import { ageFooterSegment, savedCopyFooterSegment } from "../../../components/layout/pane/footer";
16
17
  import { CountryFlag } from "../../../components/ui/country-flag";
@@ -19,7 +20,8 @@ import { useFxRatesMap } from "../../../market-data/hooks";
19
20
  import { resolveEntryData } from "../../../market-data/selectors";
20
21
  import { useRemoteUiNode } from "../../../remote/semantic-tree";
21
22
  import { usePaneSettingValue, useUpdatePaneSettings } from "../../../state/app/context";
22
- import { colors } from "../../../theme/colors";
23
+ import { colors, shownPriceColor } from "../../../theme/colors";
24
+ import { formatPercentRaw, MISSING_VALUE } from "../../../utils/format";
23
25
  import type {
24
26
  CommandBarResultDef, CommandBarSearchProvider, GloomPluginContext, PaneProps, PaneTemplateContext, PaneTemplateCreateOptions,
25
27
  PaneTemplateInstanceConfig,
@@ -55,6 +57,10 @@ const CURRENCY_FLAGS = new Map<string, ReactNode>(
55
57
  FX_CURRENCIES.map((currency) => [currency, <CountryFlag region={CURRENCY_FLAG_REGIONS[currency]} />]),
56
58
  );
57
59
  const RATE_COLUMN_WIDTH = 10;
60
+ /** Room for `-12.34%`; the header takes what it needs. */
61
+ const MOVE_COLUMN_WIDTH = 9;
62
+ /** The currencies the day's move must fit beside: the eight majors the board opens with. */
63
+ const MOVE_FITS_BESIDE = 8;
58
64
  /** Snapshot rates reload at this pace while the feed is not carrying every leg. */
59
65
  const FX_FALLBACK_REFRESH_MS = 60_000;
60
66
 
@@ -252,17 +258,34 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
252
258
  const value = convertedAmount(currency);
253
259
  return value == null ? 1 : formatAmountFigure(value, currency).length;
254
260
  })) : 0;
255
- const allColumns = useMemo<DataTableColumn[]>(() => [
256
- { id: "base", label: "", width: flagged ? FLAGGED_BASE_COLUMN_WIDTH : BASE_COLUMN_WIDTH, align: "left" },
257
- ...amount ? [{ id: "amount", label: "Amount", width: amountWidth, align: "right" as const }] : [],
258
- ...currencies.map((currency) => ({
259
- id: currency,
260
- label: currency,
261
- width: RATE_COLUMN_WIDTH,
262
- align: "right" as const,
263
- headerLeading: flagged ? CURRENCY_FLAGS.get(currency) : undefined,
264
- })),
265
- ], [amount != null, amountWidth, currencies, flagged]);
261
+ // Each currency's value in dollars, its move on the day: the row currency against the dollar, so JPY -0.51% is the
262
+ // yen 0.51% weaker (USD/JPY up), read from its dollar pair against that pair's previous daily close (the references
263
+ // the cells' tints read). The dollar is the reference, so it has none.
264
+ const moveVsUsd = useCallback((row: string): number | null => {
265
+ if (row === "USD") return null;
266
+ const rate = rates.get(row);
267
+ const reference = directionReferences.get(row);
268
+ return rate == null || reference == null || !Number.isFinite(rate) || rate <= 0 ? null : crossMovePercent(rate, reference, 1, 1);
269
+ }, [directionReferences, rates]);
270
+ // The move is shown where it fits beside the first eight currencies; a pane with no room for both (a board saved
271
+ // at its old width) shows the currencies as it did, and one too narrow for them scrolls to the rest.
272
+ const allColumns = useMemo<DataTableColumn[]>(() => {
273
+ const columns: DataTableColumn[] = [
274
+ { id: "base", label: "", width: flagged ? FLAGGED_BASE_COLUMN_WIDTH : BASE_COLUMN_WIDTH, align: "left" },
275
+ ...amount ? [{ id: "amount", label: "Amount", width: amountWidth, align: "right" as const }] : [],
276
+ { id: "move", label: "1D in USD", width: MOVE_COLUMN_WIDTH, align: "right",
277
+ title: "Each currency's value in US dollars, its move since its dollar pair's previous daily close: JPY -0.51% is the yen 0.51% weaker against the dollar" },
278
+ ...currencies.map((currency) => ({
279
+ id: currency,
280
+ label: currency,
281
+ width: RATE_COLUMN_WIDTH,
282
+ align: "right" as const,
283
+ headerLeading: flagged ? CURRENCY_FLAGS.get(currency) : undefined,
284
+ })),
285
+ ];
286
+ const throughEighth = columns.slice(0, columns.length - Math.max(0, currencies.length - MOVE_FITS_BESIDE));
287
+ return getTableWidth(throughEighth) <= width - 1 ? columns : columns.filter((column) => column.id !== "move");
288
+ }, [amount != null, amountWidth, currencies, flagged, width]);
266
289
 
267
290
  const renderCell = useCallback((
268
291
  row: FxCurrency,
@@ -279,6 +302,12 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
279
302
  };
280
303
  }
281
304
 
305
+ if (column.id === "move") {
306
+ const move = moveVsUsd(row);
307
+ if (move == null) return { text: row !== "USD" && status.loading > 0 ? "…" : MISSING_VALUE, color: colors.textDim };
308
+ return { text: formatPercentRaw(move), value: move, color: shownPriceColor(move, 2) };
309
+ }
310
+
282
311
  if (column.id === "amount") {
283
312
  const value = convertedAmount(row);
284
313
  if (value == null) return { text: status.loading > 0 ? "…" : "—", color: colors.textDim };
@@ -311,7 +340,7 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
311
340
  ? directionTint(level, { background: colors.selected, text: colors.selectedText })
312
341
  : directionTint(level, { background: colors.bg, text: colors.text });
313
342
  return { text: formatRate(base / quote, quoteCurrency, reference), color: colors.text, backgroundColor };
314
- }, [amount?.currency, convertedAmount, directionReferences, flagged, rates, referenceRates, status.loading]);
343
+ }, [amount?.currency, convertedAmount, directionReferences, flagged, moveVsUsd, rates, referenceRates, status.loading]);
315
344
 
316
345
  const handleKeyDown = useCallback((event: DataTableKeyEvent) => handleRefreshKey(event, refresh), [refresh]);
317
346
 
@@ -469,7 +498,8 @@ export const fxMatrixModule: PluginModule = {
469
498
  component: FxMatrixPane,
470
499
  defaultPosition: "right",
471
500
  defaultMode: "floating",
472
- defaultFloatingSize: { width: 105, height: 14 },
501
+ // Room for the eight majors after the codes and the day's move in dollars; narrower, the move gives way.
502
+ defaultFloatingSize: { width: 115, height: 14 },
473
503
  tableExport: true,
474
504
  settings: fxMatrixSettings,
475
505
  },
@@ -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");
@@ -53,6 +53,7 @@ import type { KeybindingsConfig } from "../../../types/config";
53
53
  import type { KeyboardShortcut } from "../../../types/plugin";
54
54
  import { useUiHost } from "../../../ui";
55
55
  import { isPlainKey } from "../../../utils/keyboard";
56
+ import { logFailure } from "../../../utils/log-failure";
56
57
  import { detectShortcutPlatform, getShortcutDisplayMode } from "../../../utils/shortcut-labels";
57
58
  import { getSharedRegistry } from "../../registry";
58
59
  import { usePluginAppActions } from "../../runtime";
@@ -218,8 +219,11 @@ export function KeybindingsEditor({
218
219
 
219
220
  const writeKeybindings = useCallback((next: KeybindingsConfig | undefined) => {
220
221
  dispatch({ type: "SET_KEYBINDINGS", keybindings: next });
221
- void saveConfigImmediately(updateKeybindingsConfig(stateRef.current.config, next));
222
- }, [dispatch, stateRef]);
222
+ saveConfigImmediately(updateKeybindingsConfig(stateRef.current.config, next)).catch((error: unknown) => {
223
+ logFailure("help.keybindings", "Saving keybindings failed")(error);
224
+ notify({ type: "error", body: t("Could not save your keybindings.") });
225
+ });
226
+ }, [dispatch, notify, stateRef]);
223
227
 
224
228
  const startCapture = useCallback((target: CaptureTarget) => {
225
229
  setFeedback(null);
@@ -256,7 +260,7 @@ export function KeybindingsEditor({
256
260
  return;
257
261
  }
258
262
  // A built-in action's key is refused, so a binding never leaves the command bar or close pane dead.
259
- const core = coreActionOnChord(resolved, chord, capture.kind === "row" ? capture.row.action?.id : undefined);
263
+ const core = coreActionOnChord(resolved, chord, capture.kind === "row" ? capture.row.action?.id : undefined, { command: isCommand });
260
264
  if (core) {
261
265
  setFeedback({ tone: "warning", text: takenChordMessage(formatChord(chord), core) });
262
266
  return;
@@ -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",
@@ -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);
@@ -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",
@@ -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],