@gloom-sh/terminal 0.20.17 → 0.20.19

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 (453) hide show
  1. package/package.json +3 -1
  2. package/src/account/auth-dialog.tsx +19 -1
  3. package/src/account/billing.ts +2 -1
  4. package/src/account/heard-from-question.tsx +235 -0
  5. package/src/account/heard-from.ts +97 -0
  6. package/src/api-client/cot.ts +5 -6
  7. package/src/api-client/data.ts +14 -3
  8. package/src/api-client/heard-from.ts +72 -0
  9. package/src/api-client/index.ts +64 -6
  10. package/src/api-client/mna.ts +18 -0
  11. package/src/api-client/request.ts +162 -40
  12. package/src/api-client/supply-chain.ts +9 -0
  13. package/src/api-client/types/billing.ts +35 -1
  14. package/src/api-client/types/news.ts +45 -0
  15. package/src/api-client/types/world-venues.ts +9 -0
  16. package/src/app/global-shortcuts.ts +5 -3
  17. package/src/app/pro-welcome/keys.ts +27 -0
  18. package/src/app/pro-welcome/model.ts +158 -0
  19. package/src/app/pro-welcome/row.tsx +176 -0
  20. package/src/app/pro-welcome/use-pro-welcome.ts +156 -0
  21. package/src/app/runtime/external-profile-changes.ts +135 -0
  22. package/src/app.tsx +37 -4
  23. package/src/architecture/core-builtin-allowlist.json +1 -1
  24. package/src/architecture/floating-promise-allowlist.json +1 -2
  25. package/src/architecture/shortcut-labels-allowlist.json +1 -0
  26. package/src/cli/alert-listing.ts +98 -0
  27. package/src/cli/commands/market.ts +191 -39
  28. package/src/cli/commands/overview.ts +7 -1
  29. package/src/cli/commands/plugins.ts +3 -2
  30. package/src/cli/commands/search.ts +30 -6
  31. package/src/cli/commands/ticker.ts +13 -6
  32. package/src/cli/context.ts +24 -5
  33. package/src/cli/csv-export.ts +2 -1
  34. package/src/cli/desktop-pane-shot-browser.ts +3 -1
  35. package/src/cli/desktop-pane-shot-view.ts +0 -1
  36. package/src/cli/desktop-pane-shot.ts +276 -52
  37. package/src/cli/errors.ts +3 -9
  38. package/src/cli/exit-codes.ts +1 -1
  39. package/src/cli/glossary.ts +65 -11
  40. package/src/cli/help.ts +1 -1
  41. package/src/cli/history-demergers.ts +117 -0
  42. package/src/cli/history-rows.ts +8 -4
  43. package/src/cli/index.ts +2 -1
  44. package/src/cli/known-gaps.ts +16 -0
  45. package/src/cli/known-us-stocks.ts +18 -0
  46. package/src/cli/listing-arg.ts +192 -38
  47. package/src/cli/pane-functions/catalog-snapshot-build.ts +83 -0
  48. package/src/cli/pane-functions/catalog-snapshot.json +877 -0
  49. package/src/cli/pane-functions/catalog-snapshot.ts +62 -0
  50. package/src/cli/pane-functions/catalog.ts +50 -16
  51. package/src/cli/pane-functions/data.ts +16 -4
  52. package/src/cli/pane-functions/dom.ts +54 -8
  53. package/src/cli/pane-functions/freshness.ts +39 -4
  54. package/src/cli/pane-functions/function-help.ts +3 -3
  55. package/src/cli/pane-functions/headless.ts +9 -1
  56. package/src/cli/pane-functions/index.ts +175 -50
  57. package/src/cli/pane-functions/report-notices.ts +10 -0
  58. package/src/cli/pane-functions/resolver.ts +11 -7
  59. package/src/cli/pane-functions/screenshot-assessment.ts +38 -10
  60. package/src/cli/pane-functions/screenshot-data-evidence.ts +7 -15
  61. package/src/cli/pane-functions/screenshot-payload.ts +36 -1
  62. package/src/cli/pane-functions/screenshot-render.ts +24 -9
  63. package/src/cli/pane-functions/screenshot-types.ts +9 -0
  64. package/src/cli/quote-answer.ts +33 -17
  65. package/src/cli/registry.ts +22 -2
  66. package/src/cli/result.ts +22 -4
  67. package/src/cli/scroll-truncation.ts +7 -2
  68. package/src/cli/series-search.ts +45 -6
  69. package/src/cli/shot-temp-dir.ts +4 -9
  70. package/src/cli/ticker-resolution.ts +1 -1
  71. package/src/cli/unreachable.ts +21 -0
  72. package/src/components/chart/composite/drawing-store.ts +11 -7
  73. package/src/components/chart/composite/format.ts +1 -0
  74. package/src/components/chart/composite/legend.tsx +48 -20
  75. package/src/components/chart/composite/panel-surface/panel-cursor.tsx +3 -3
  76. package/src/components/chart/composite/panel-surface/plot-gestures.ts +9 -2
  77. package/src/components/chart/composite/panel-surface.tsx +1 -1
  78. package/src/components/chart/composite/price-axis-labels.tsx +7 -5
  79. package/src/components/chart/composite/tools.ts +164 -39
  80. package/src/components/chart-table/header.tsx +11 -2
  81. package/src/components/chart-table/layout.ts +16 -17
  82. package/src/components/command-bar/pane-templates/items.ts +17 -1
  83. package/src/components/command-bar/routes/root/provider-search.ts +10 -1
  84. package/src/components/command-bar/routes/root/results.ts +34 -2
  85. package/src/components/command-bar/routes/root/runtime.ts +19 -4
  86. package/src/components/command-bar/routes/ticker-search/results.ts +5 -0
  87. package/src/components/command-bar/routes/ticker-search/route.ts +5 -0
  88. package/src/components/command-bar/selection-runtime.ts +29 -5
  89. package/src/components/command-bar/surface/index.tsx +4 -1
  90. package/src/components/command-bar/workflow/alert.ts +32 -13
  91. package/src/components/data-table/view.tsx +15 -2
  92. package/src/components/form-modal/content.tsx +9 -4
  93. package/src/components/index.ts +1 -1
  94. package/src/components/layout/header.tsx +9 -5
  95. package/src/components/layout/pane/capture-status.ts +6 -0
  96. package/src/components/layout/pane/footer/index.tsx +2 -0
  97. package/src/components/layout/pane/footer/model.ts +123 -17
  98. package/src/components/layout/pane/header.tsx +16 -2
  99. package/src/components/layout/pane/status-footer.ts +24 -0
  100. package/src/components/market-board/index.tsx +4 -2
  101. package/src/components/onboarding/onboarding-frame.tsx +6 -2
  102. package/src/components/onboarding/onboarding-keyboard.ts +7 -1
  103. package/src/components/onboarding/onboarding-wizard.tsx +3 -1
  104. package/src/components/onboarding/portfolio-step/positions-panel.tsx +24 -15
  105. package/src/components/onboarding/setup-cards.ts +36 -0
  106. package/src/components/onboarding/use-onboarding-progress.ts +22 -1
  107. package/src/components/onboarding/wizard-account.ts +6 -1
  108. package/src/components/onboarding/wizard-model.ts +32 -6
  109. package/src/components/onboarding/wizard-positions.ts +1 -1
  110. package/src/components/price-performance.tsx +26 -8
  111. package/src/components/reader/article-reader.tsx +12 -5
  112. package/src/components/sign-in-gate.tsx +3 -1
  113. package/src/components/toggle-list.tsx +6 -8
  114. package/src/components/ui/confirm-dialog.tsx +47 -7
  115. package/src/components/ui/data-table/opentui/index.tsx +7 -0
  116. package/src/components/ui/data-table/types.ts +8 -0
  117. package/src/components/ui/display.tsx +17 -2
  118. package/src/components/ui/index.ts +1 -1
  119. package/src/components/ui/stat-grid.tsx +4 -0
  120. package/src/components/ui/status.tsx +13 -1
  121. package/src/components/ui/table-layout.ts +34 -2
  122. package/src/components/use-pane-notice-footer.tsx +16 -3
  123. package/src/data/config/store/index.ts +31 -0
  124. package/src/data/config/store/node.ts +61 -11
  125. package/src/data/config/store/normalize.ts +4 -6
  126. package/src/data/config/store/shared-file.ts +309 -0
  127. package/src/data/profile-merge.ts +299 -0
  128. package/src/data/sqlite/checkpointer.ts +11 -1
  129. package/src/data/sqlite/database.ts +1 -1
  130. package/src/data/ticker-repository.ts +134 -10
  131. package/src/data/ticker-store.ts +67 -0
  132. package/src/data/ticker-writes.ts +5 -0
  133. package/src/i18n/es.ts +27 -0
  134. package/src/i18n/ja.ts +27 -0
  135. package/src/i18n/ko.ts +27 -0
  136. package/src/i18n/zh-cn.ts +27 -0
  137. package/src/i18n/zh-tw.ts +27 -0
  138. package/src/layout-marketplace/gallery-desktop.tsx +2 -2
  139. package/src/market-data/ah-pair.ts +122 -0
  140. package/src/market-data/coordinator/entries.ts +6 -4
  141. package/src/market-data/coordinator/index.ts +14 -3
  142. package/src/market-data/depositary-pair.ts +6 -2
  143. package/src/market-data/futures-board.ts +36 -29
  144. package/src/market-data/futures-contract.ts +37 -1
  145. package/src/market-data/hooks.tsx +33 -2
  146. package/src/market-data/market/change-basis.ts +11 -1
  147. package/src/market-data/market/header-market.ts +11 -0
  148. package/src/market-data/market/status.ts +40 -4
  149. package/src/market-data/performance.ts +127 -32
  150. package/src/market-data/quotes/time.ts +5 -2
  151. package/src/market-data/split-terms.ts +28 -0
  152. package/src/news/types.ts +28 -0
  153. package/src/notifications/app-badge.ts +2 -3
  154. package/src/notifications/app-notifier.ts +5 -0
  155. package/src/plugins/builtin/account-management/footer.ts +1 -1
  156. package/src/plugins/builtin/account-management/keyboard.ts +4 -0
  157. package/src/plugins/builtin/account-management/model.ts +1 -0
  158. package/src/plugins/builtin/account-management/pane.tsx +75 -7
  159. package/src/plugins/builtin/account-management/payment-recovery-row.tsx +12 -5
  160. package/src/plugins/builtin/account-management/pro-cancel.tsx +197 -0
  161. package/src/plugins/builtin/account-management/trial-cancel.ts +1 -1
  162. package/src/plugins/builtin/alerts/cli-move.ts +2 -2
  163. package/src/plugins/builtin/alerts/cli.ts +101 -48
  164. package/src/plugins/builtin/alerts/command.ts +39 -9
  165. package/src/plugins/builtin/alerts/constants.ts +10 -0
  166. package/src/plugins/builtin/alerts/earnings-listing.ts +20 -0
  167. package/src/plugins/builtin/alerts/event-rows.ts +9 -3
  168. package/src/plugins/builtin/alerts/events-pane.tsx +16 -10
  169. package/src/plugins/builtin/alerts/format.ts +24 -8
  170. package/src/plugins/builtin/alerts/headless.ts +12 -6
  171. package/src/plugins/builtin/alerts/index.tsx +97 -16
  172. package/src/plugins/builtin/alerts/move-checks.ts +7 -0
  173. package/src/plugins/builtin/alerts/option-contract.ts +197 -0
  174. package/src/plugins/builtin/alerts/pane.tsx +1 -1
  175. package/src/plugins/builtin/alerts/price.ts +30 -5
  176. package/src/plugins/builtin/alerts/pro-rules.ts +62 -0
  177. package/src/plugins/builtin/alerts/quotes.ts +26 -2
  178. package/src/plugins/builtin/alerts/research-builder.ts +5 -10
  179. package/src/plugins/builtin/alerts/scheduled.ts +6 -1
  180. package/src/plugins/builtin/alerts/types.ts +7 -0
  181. package/src/plugins/builtin/analytics/account-returns.ts +1 -1
  182. package/src/plugins/builtin/analytics/manual-value.ts +61 -0
  183. package/src/plugins/builtin/analytics/pane-model.ts +2 -2
  184. package/src/plugins/builtin/analytics/risk-book.ts +7 -7
  185. package/src/plugins/builtin/analytics/risk-client.ts +27 -14
  186. package/src/plugins/builtin/analytics/risk-headless.ts +13 -8
  187. package/src/plugins/builtin/analytics/risk-model.ts +92 -4
  188. package/src/plugins/builtin/analytics/risk-pane.tsx +85 -38
  189. package/src/plugins/builtin/awards/pane.tsx +1 -1
  190. package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
  191. package/src/plugins/builtin/buildout/company/pane.tsx +4 -14
  192. package/src/plugins/builtin/catalysts/model.ts +2 -1
  193. package/src/plugins/builtin/central-bank-rates/model.ts +8 -2
  194. package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -3
  195. package/src/plugins/builtin/chart-composer/chart-spec.ts +5 -0
  196. package/src/plugins/builtin/chart-composer/cli-options.ts +9 -5
  197. package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +2 -6
  198. package/src/plugins/builtin/chart-composer/headless-schema.ts +14 -10
  199. package/src/plugins/builtin/chart-composer/headless.ts +2 -0
  200. package/src/plugins/builtin/chart-composer/index.tsx +17 -5
  201. package/src/plugins/builtin/chart-composer/pane.tsx +19 -6
  202. package/src/plugins/builtin/chart-composer/viewport-labels.ts +2 -17
  203. package/src/plugins/builtin/chat/controller/notifications.ts +1 -0
  204. package/src/plugins/builtin/chat/index.tsx +0 -1
  205. package/src/plugins/builtin/cloud/auth-actions.tsx +11 -6
  206. package/src/plugins/builtin/cloud/company-picker.tsx +5 -3
  207. package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
  208. package/src/plugins/builtin/commodities-energy/index.tsx +1 -1
  209. package/src/plugins/builtin/company-kpis/headless.ts +10 -5
  210. package/src/plugins/builtin/company-kpis/latest.ts +45 -0
  211. package/src/plugins/builtin/company-kpis/model.ts +57 -15
  212. package/src/plugins/builtin/company-kpis/pane.tsx +22 -8
  213. package/src/plugins/builtin/composite/alt-data.ts +20 -0
  214. package/src/plugins/builtin/composite/application.ts +14 -0
  215. package/src/plugins/builtin/composite/broker.ts +12 -0
  216. package/src/plugins/builtin/composite/credit.ts +33 -0
  217. package/src/plugins/builtin/composite/crypto.ts +10 -0
  218. package/src/plugins/builtin/composite/earnings.ts +12 -0
  219. package/src/plugins/builtin/composite/filings.ts +13 -0
  220. package/src/plugins/builtin/composite/futures-commodities.ts +23 -0
  221. package/src/plugins/builtin/composite/global-markets.ts +12 -0
  222. package/src/plugins/builtin/composite/options-volatility.ts +23 -0
  223. package/src/plugins/builtin/composite/ownership.ts +23 -0
  224. package/src/plugins/builtin/composite/portfolio.ts +10 -0
  225. package/src/plugins/builtin/composite/quant.ts +15 -0
  226. package/src/plugins/builtin/composite/rates-macro.ts +30 -0
  227. package/src/plugins/builtin/composite/screeners.ts +11 -0
  228. package/src/plugins/builtin/composite/shared.ts +11 -0
  229. package/src/plugins/builtin/composite/ticker-core.ts +36 -0
  230. package/src/plugins/builtin/congress-trades/headless.ts +31 -3
  231. package/src/plugins/builtin/congress-trades/model.ts +9 -5
  232. package/src/plugins/builtin/correlation/index.tsx +13 -17
  233. package/src/plugins/builtin/correlation/matrix/model.ts +18 -0
  234. package/src/plugins/builtin/cot/client.ts +2 -3
  235. package/src/plugins/builtin/cot/headless.ts +16 -16
  236. package/src/plugins/builtin/cot/index.tsx +6 -6
  237. package/src/plugins/builtin/cot/model.ts +25 -5
  238. package/src/plugins/builtin/cot/pane.tsx +11 -6
  239. package/src/plugins/builtin/cot/series.ts +11 -8
  240. package/src/plugins/builtin/cpi/model.ts +15 -4
  241. package/src/plugins/builtin/cpi/pane.tsx +29 -7
  242. package/src/plugins/builtin/dividend-yield/client.ts +57 -16
  243. package/src/plugins/builtin/dividend-yield/headless.ts +17 -11
  244. package/src/plugins/builtin/dividend-yield/model.ts +4 -3
  245. package/src/plugins/builtin/dividend-yield/pane.tsx +22 -18
  246. package/src/plugins/builtin/dividend-yield/ranking.ts +1 -1
  247. package/src/plugins/builtin/dividend-yield/types.ts +4 -0
  248. package/src/plugins/builtin/dividend-yield/view.ts +23 -12
  249. package/src/plugins/builtin/doe/model.ts +30 -0
  250. package/src/plugins/builtin/doe/pane.tsx +8 -2
  251. package/src/plugins/builtin/earnings/board-table.ts +9 -4
  252. package/src/plugins/builtin/earnings/fiscal-quarter.ts +39 -0
  253. package/src/plugins/builtin/earnings/headless.ts +16 -6
  254. package/src/plugins/builtin/earnings/history-model.ts +6 -4
  255. package/src/plugins/builtin/earnings/history-table.ts +7 -4
  256. package/src/plugins/builtin/earnings-calls/calendar.tsx +4 -3
  257. package/src/plugins/builtin/earnings-calls/pane.tsx +8 -2
  258. package/src/plugins/builtin/earnings-ripple/pane.tsx +2 -2
  259. package/src/plugins/builtin/econ/calendar-model.ts +16 -0
  260. package/src/plugins/builtin/econ/index.tsx +7 -2
  261. package/src/plugins/builtin/equity-screener/headless.ts +4 -1
  262. package/src/plugins/builtin/equity-screener/model.ts +7 -6
  263. package/src/plugins/builtin/estimate-revisions/headless.ts +1 -1
  264. package/src/plugins/builtin/exposure/model.ts +10 -0
  265. package/src/plugins/builtin/exposure/pane.tsx +10 -3
  266. package/src/plugins/builtin/futures/model.ts +14 -1
  267. package/src/plugins/builtin/futures/series.ts +1 -8
  268. package/src/plugins/builtin/fx-matrix/amount.ts +15 -1
  269. package/src/plugins/builtin/fx-matrix/headless.ts +12 -6
  270. package/src/plugins/builtin/fx-matrix/index.tsx +25 -7
  271. package/src/plugins/builtin/fx-matrix/settings.ts +9 -4
  272. package/src/plugins/builtin/insider/detail.tsx +36 -7
  273. package/src/plugins/builtin/insider/filing-stories.ts +110 -0
  274. package/src/plugins/builtin/insider/headless.ts +37 -2
  275. package/src/plugins/builtin/insider/index.tsx +79 -10
  276. package/src/plugins/builtin/insider/model.ts +43 -5
  277. package/src/plugins/builtin/ipo-calendar/client.ts +11 -1
  278. package/src/plugins/builtin/ipo-calendar/model.ts +3 -7
  279. package/src/plugins/builtin/jobs/headless.ts +2 -1
  280. package/src/plugins/builtin/jobs/model.ts +6 -0
  281. package/src/plugins/builtin/jobs/pane.tsx +8 -3
  282. package/src/plugins/builtin/kelly-sizer/pane.tsx +9 -4
  283. package/src/plugins/builtin/market-valuation/pane.tsx +22 -10
  284. package/src/plugins/builtin/mna/detail.tsx +67 -6
  285. package/src/plugins/builtin/mna/headless.ts +128 -13
  286. package/src/plugins/builtin/mna/model.ts +219 -16
  287. package/src/plugins/builtin/mna/pane.tsx +34 -6
  288. package/src/plugins/builtin/money-markets/model.ts +14 -5
  289. package/src/plugins/builtin/money-markets/pane.tsx +4 -3
  290. package/src/plugins/builtin/news/wire/news/detail-view.tsx +118 -10
  291. package/src/plugins/builtin/news/wire/news/footer.ts +3 -8
  292. package/src/plugins/builtin/news/wire/news/story-evidence.ts +178 -0
  293. package/src/plugins/builtin/options/analytics.ts +1 -1
  294. package/src/plugins/builtin/options/view.tsx +18 -11
  295. package/src/plugins/builtin/options-positioning/model.ts +11 -0
  296. package/src/plugins/builtin/options-positioning/pane.tsx +22 -1
  297. package/src/plugins/builtin/options-scenario/client.ts +49 -8
  298. package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +22 -6
  299. package/src/plugins/builtin/options-scenario/csp-screen.ts +39 -12
  300. package/src/plugins/builtin/options-scenario/headless.ts +7 -3
  301. package/src/plugins/builtin/options-scenario/model.ts +33 -2
  302. package/src/plugins/builtin/options-scenario/pane.tsx +3 -4
  303. package/src/plugins/builtin/options-scenario/strategy-screen.ts +7 -5
  304. package/src/plugins/builtin/pe-band/client.ts +13 -1
  305. package/src/plugins/builtin/pe-band/headless.ts +2 -2
  306. package/src/plugins/builtin/pe-band/model.ts +63 -10
  307. package/src/plugins/builtin/pe-band/pane.tsx +5 -5
  308. package/src/plugins/builtin/perps/cascade.ts +4 -3
  309. package/src/plugins/builtin/perps/markets-section.tsx +5 -2
  310. package/src/plugins/builtin/perps/model.ts +4 -3
  311. package/src/plugins/builtin/portfolio-list/allocation-rows.ts +26 -7
  312. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +66 -13
  313. package/src/plugins/builtin/portfolio-list/cli/render.ts +76 -33
  314. package/src/plugins/builtin/portfolio-list/headless.ts +69 -22
  315. package/src/plugins/builtin/portfolio-list/pane/data.ts +3 -3
  316. package/src/plugins/builtin/portfolio-list/pane/index.tsx +29 -14
  317. package/src/plugins/builtin/portfolio-list/summary/index.tsx +2 -2
  318. package/src/plugins/builtin/portfolio-list/table.tsx +3 -2
  319. package/src/plugins/builtin/relative-rotation/pane.tsx +2 -3
  320. package/src/plugins/builtin/research/corporate-actions-pane.tsx +33 -14
  321. package/src/plugins/builtin/research/event-model.ts +43 -19
  322. package/src/plugins/builtin/research/headless.ts +8 -1
  323. package/src/plugins/builtin/research/relative-valuation-pane.tsx +19 -17
  324. package/src/plugins/builtin/research-search/index.tsx +3 -1
  325. package/src/plugins/builtin/scanner/denied.tsx +16 -4
  326. package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
  327. package/src/plugins/builtin/scanner/hilo-pane.tsx +1 -1
  328. package/src/plugins/builtin/sec/filing-display.tsx +14 -2
  329. package/src/plugins/builtin/sec/headless.ts +42 -4
  330. package/src/plugins/builtin/sec/index.tsx +21 -1
  331. package/src/plugins/builtin/sectors/index.tsx +6 -9
  332. package/src/plugins/builtin/sectors/sector-model.ts +1 -1
  333. package/src/plugins/builtin/shared/cloud-upgrade.ts +1 -1
  334. package/src/plugins/builtin/shared/earnings-report.ts +49 -5
  335. package/src/plugins/builtin/shared/options-pro-copy.ts +34 -0
  336. package/src/plugins/builtin/shared/report-freshness.ts +2 -3
  337. package/src/plugins/builtin/shared/statement-currency.ts +23 -0
  338. package/src/plugins/builtin/shared/ticker-surface.ts +1 -1
  339. package/src/plugins/builtin/supply-chain/client.ts +34 -9
  340. package/src/plugins/builtin/supply-chain/evidence.ts +3 -2
  341. package/src/plugins/builtin/supply-chain/flow.tsx +4 -3
  342. package/src/plugins/builtin/supply-chain/graph-model.ts +14 -7
  343. package/src/plugins/builtin/supply-chain/graph-pane.tsx +3 -1
  344. package/src/plugins/builtin/supply-chain/graph.tsx +6 -3
  345. package/src/plugins/builtin/supply-chain/headless.ts +19 -4
  346. package/src/plugins/builtin/supply-chain/model.ts +50 -6
  347. package/src/plugins/builtin/supply-chain/pane.tsx +79 -18
  348. package/src/plugins/builtin/themes/headless.ts +4 -4
  349. package/src/plugins/builtin/themes/model.ts +11 -8
  350. package/src/plugins/builtin/themes/pane.tsx +2 -2
  351. package/src/plugins/builtin/ticker-detail/adr-pair/ah.ts +62 -0
  352. package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +119 -20
  353. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +51 -1
  354. package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +25 -14
  355. package/src/plugins/builtin/ticker-detail/financials/model.ts +22 -32
  356. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +7 -9
  357. package/src/plugins/builtin/ticker-detail/headless-schema.ts +2 -0
  358. package/src/plugins/builtin/ticker-detail/headless.ts +28 -12
  359. package/src/plugins/builtin/ticker-detail/overview/board-lot.ts +21 -0
  360. package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -2
  361. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +8 -0
  362. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +68 -13
  363. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +9 -2
  364. package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +5 -2
  365. package/src/plugins/builtin/volatility/model.ts +17 -0
  366. package/src/plugins/builtin/volatility/pane.tsx +16 -7
  367. package/src/plugins/builtin/world-indices/index.tsx +2 -0
  368. package/src/plugins/builtin/world-indices/table.tsx +15 -0
  369. package/src/plugins/builtin/world-venue-map/evidence.ts +3 -2
  370. package/src/plugins/builtin/world-venue-map/headless.ts +32 -18
  371. package/src/plugins/builtin/world-venue-map/index.ts +19 -6
  372. package/src/plugins/builtin/world-venue-map/layered-pane.tsx +9 -5
  373. package/src/plugins/builtin/world-venue-map/layers.ts +33 -11
  374. package/src/plugins/builtin/world-venue-map/map.tsx +12 -0
  375. package/src/plugins/builtin/world-venue-map/model.ts +6 -1
  376. package/src/plugins/builtin/world-venue-map/pane.tsx +35 -6
  377. package/src/plugins/builtin/world-venue-map/place.ts +119 -0
  378. package/src/plugins/builtin/world-venue-map/venue-header.tsx +5 -3
  379. package/src/plugins/catalog-browser.ts +10 -1
  380. package/src/plugins/catalog-data.ts +20 -0
  381. package/src/plugins/catalog-lazy.ts +51 -0
  382. package/src/plugins/catalog-ui.ts +16 -18
  383. package/src/plugins/host-smoke.ts +5 -2
  384. package/src/portfolio/allocation.ts +79 -19
  385. package/src/portfolio/cash-balances.ts +76 -0
  386. package/src/portfolio/mutations.ts +43 -8
  387. package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
  388. package/src/renderers/browser/activity.ts +16 -0
  389. package/src/renderers/browser/app-badge-host.ts +14 -0
  390. package/src/renderers/browser/main.tsx +5 -0
  391. package/src/renderers/browser/notifications.ts +103 -0
  392. package/src/renderers/browser/ui-host.tsx +4 -0
  393. package/src/renderers/desktop/window-layouts.ts +14 -0
  394. package/src/renderers/dom/data-table/index.tsx +27 -4
  395. package/src/renderers/dom/data-table/row.tsx +2 -0
  396. package/src/renderers/dom/host/tabs.tsx +57 -8
  397. package/src/renderers/dom/styles.css +13 -5
  398. package/src/renderers/electrobun/bun/desktop/backend-requests.ts +4 -0
  399. package/src/renderers/electrobun/bun/desktop/backend.ts +22 -1
  400. package/src/renderers/electrobun/bun/window/native-min-size.ts +6 -1
  401. package/src/renderers/electrobun/shared/protocol.ts +4 -0
  402. package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +50 -12
  403. package/src/renderers/electrobun/view/http-fetch.ts +3 -2
  404. package/src/renderers/electrobun/view/remote/ticker-repository.ts +10 -0
  405. package/src/series/standalone-catalog.ts +5 -4
  406. package/src/series/standalone.ts +13 -7
  407. package/src/sources/gloomberb-cloud/index.ts +22 -9
  408. package/src/sources/gloomberb-cloud/news.ts +35 -0
  409. package/src/sources/gloomberb-cloud/perpetuals.ts +60 -3
  410. package/src/sources/provider-errors.ts +34 -7
  411. package/src/sources/provider-router/financials.ts +20 -13
  412. package/src/sources/provider-router/history.ts +32 -6
  413. package/src/sources/provider-router/index.ts +4 -0
  414. package/src/sources/provider-router/search.ts +1 -0
  415. package/src/sync/collections-contributor.ts +3 -1
  416. package/src/sync/config-merge.ts +10 -1
  417. package/src/sync/sanitize.ts +26 -2
  418. package/src/tickers/company-name-listing.ts +16 -2
  419. package/src/tickers/listing-fate.ts +12 -8
  420. package/src/tickers/renamed-listings.ts +43 -10
  421. package/src/tickers/search/home-listing.ts +28 -0
  422. package/src/tickers/search/index.ts +19 -7
  423. package/src/tickers/terminal-codes.ts +11 -1
  424. package/src/time-series/base-series.ts +39 -6
  425. package/src/time-series/chart-seed.ts +2 -2
  426. package/src/time-series/history-quality.ts +4 -1
  427. package/src/time-series/hooks.ts +2 -0
  428. package/src/time-series/price-comparison.ts +17 -23
  429. package/src/time-series/reporting.ts +1 -1
  430. package/src/time-series/resolution.ts +13 -0
  431. package/src/time-series/resolve-context.ts +6 -0
  432. package/src/time-series/resolve.ts +42 -3
  433. package/src/time-series/spec.ts +2 -2
  434. package/src/time-series/types.ts +3 -2
  435. package/src/types/data-provider.ts +11 -0
  436. package/src/types/financials.ts +48 -4
  437. package/src/types/headless.ts +1 -0
  438. package/src/types/issuer-listings.ts +2 -0
  439. package/src/types/plugin-notifications.ts +3 -0
  440. package/src/types/price-history.ts +6 -4
  441. package/src/types/ticker.ts +10 -2
  442. package/src/ui/host.tsx +2 -0
  443. package/src/utils/cli-output.ts +1 -1
  444. package/src/utils/declared-dividends.ts +13 -1
  445. package/src/utils/dividend-cash.ts +5 -1
  446. package/src/utils/exchange-announcements.ts +7 -2
  447. package/src/utils/forward-dividend.ts +4 -3
  448. package/src/utils/fundamentals.ts +40 -0
  449. package/src/utils/network-failure.ts +2 -0
  450. package/src/utils/price-history-integrity.ts +9 -1
  451. package/src/utils/remove-folder.ts +37 -0
  452. package/src/utils/trailing-dividend.ts +1 -1
  453. package/src/plugins/builtin/composite-plugins.ts +0 -285
@@ -2,7 +2,7 @@ import { MISSING_VALUE } from "../../../utils/format";
2
2
  import { logFailure } from "../../../utils/log-failure";
3
3
  import { useCallback, useEffect, useId, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
4
4
  import {
5
- Badge, Button, DataTableView, IconButton, PaneStatusBody, RatioBar, SegmentedControl, Notice, SectionHeading, confirmDialog, usePaneFooter, usePaneNoticeFooter,
5
+ Badge, Button, DataTableView, IconButton, PaneStatusBody, RatioBar, SegmentedControl, Notice, RowNote, SectionHeading, confirmDialog, usePaneFooter, usePaneNoticeFooter,
6
6
  type DataTableCell, type DataTableColumn, type SelectControl,
7
7
  } from "../../../components";
8
8
  import { loadingErrorFooterInfo, usePaneRefreshKey } from "../../../components/data-table/table-pane";
@@ -505,7 +505,7 @@ export function BrokerOrdersView({
505
505
  }}
506
506
  selection={{ kind: "id", selectedId: selected ? brokerOrderKey(selected) : "", getId: brokerOrderKey, onChange: (key) => { selectedKeyRef.current = key; setSelectedKey(key); } }}
507
507
  onActivate={modifyOrder} selectedTextOverridesCellColor emptyStateTitle="No open orders in this account."
508
- rootAfter={selectedNote ? <Box paddingX={1} flexShrink={0}><Notice tone={selectedNote.tone}>{selectedNote.text}</Notice></Box> : undefined} />
508
+ rootAfter={selectedNote ? <RowNote tone={selectedNote.tone}>{selectedNote.text}</RowNote> : undefined} />
509
509
  : <DataTableView<BrokerExecution> rootWidth={width} rootHeight={Math.max(2, height - 2)} focused={focused && !dialogOpen}
510
510
  columns={activityColumns.map((column) => column.id === "quantity" && summaries ? { ...column, label: "Cumulative qty" } : column)}
511
511
  items={snapshot?.executions ?? []} sortColumnId={null} sortDirection="desc" getItemKey={(execution) => execution.execId}
@@ -16,6 +16,7 @@ import {
16
16
  type StatItem,
17
17
  } from "../../../../components";
18
18
  import { statGridWithin } from "../../../../components/ui/stat-grid";
19
+ import { dropColumnsToFit } from "../../../../components/ui/table-layout";
19
20
  import { useAsyncResource, usePaneSettingValue, usePluginAppActions } from "../../../../public/react";
20
21
  import { usePaneStateValue } from "../../../../state/app/context";
21
22
  import { usePaneTickerIdentity } from "../../../../state/hooks/pane-ticker";
@@ -81,17 +82,6 @@ const SIGNAL_COLUMNS: BuildoutColumn[] = [
81
82
  { id: "companies", label: "Also", width: 16, align: "left" },
82
83
  ];
83
84
 
84
- /** Columns that fit `width`, the flexible ones first to give way after the fixed tail. */
85
- function fitColumns<C extends DataTableColumn>(columns: readonly C[], width: number, dropOrder: readonly string[]): C[] {
86
- let kept = [...columns];
87
- for (const id of dropOrder) {
88
- const total = kept.reduce((sum, column) => sum + column.width + 1, 0);
89
- if (total <= width) break;
90
- kept = kept.filter((column) => column.id !== id);
91
- }
92
- return kept;
93
- }
94
-
95
85
  function headerItems(profile: BuildoutCompanyProfile): StatItem[] {
96
86
  const count = (role: BuildoutRelation["role"]) => profile.relations.filter((relation) => relation.role === role).length;
97
87
  const power = count("power");
@@ -233,7 +223,7 @@ export function BuildoutCompanyPane({ focused, width, height }: PaneProps) {
233
223
  </ScrollBox>
234
224
  );
235
225
  } else if (tab === "sites") {
236
- const columns = fitColumns(SITE_COLUMNS, width - 1, ["place", "type", "mw"]);
226
+ const columns = dropColumnsToFit(SITE_COLUMNS, width - 1, ["place", "type", "mw"]);
237
227
  body = (
238
228
  <DataTableStackView<BuildoutCompanySite, SiteColumn>
239
229
  focused={focused}
@@ -253,7 +243,7 @@ export function BuildoutCompanyPane({ focused, width, height }: PaneProps) {
253
243
  />
254
244
  );
255
245
  } else if (tab === "hiring") {
256
- const columns = fitColumns(HIRING_COLUMNS, width - 1, ["site", "family", "change"]);
246
+ const columns = dropColumnsToFit(HIRING_COLUMNS, width - 1, ["site", "family", "change"]);
257
247
  body = company.hiring.segments.length ? (
258
248
  <DataTableStackView<BuildoutHiringSegment, HiringColumn>
259
249
  focused={focused}
@@ -298,7 +288,7 @@ export function BuildoutCompanyPane({ focused, width, height }: PaneProps) {
298
288
  )}
299
289
  rootWidth={width}
300
290
  rootHeight={bodyHeight}
301
- columns={fitColumns(SIGNAL_COLUMNS, width - 1, ["companies"])}
291
+ columns={dropColumnsToFit(SIGNAL_COLUMNS, width - 1, ["companies"])}
302
292
  sortColumnId={null}
303
293
  sortDirection="asc"
304
294
  items={signalRows}
@@ -1,6 +1,7 @@
1
1
  import { MISSING_VALUE } from "../../../utils/format";
2
2
  import type { CatalystEvent, CatalystFilters, CatalystResponse, CatalystType } from "../../../api-client/catalysts";
3
3
  import type { DataTableColumn, TableSection } from "../../../components";
4
+ import { markHiddenTableColumns } from "../../../components/ui/table-layout";
4
5
  import { publicTickerKey } from "../../../utils/exchanges";
5
6
  import { humanLabel, type StateTone } from "../shared/research-cells";
6
7
 
@@ -90,7 +91,7 @@ function fitColumns(columns: FitColumn[], width: number): DataTableColumn[] {
90
91
  if (over > 0) kept = kept.map((column) => column.id === "basis" ? { ...column, width: Math.max(column.min ?? column.width, column.width - over) } : column);
91
92
  if (tableNeed(kept) > width) kept = kept.map((column) => ({ ...column, width: column.min ?? column.width }));
92
93
  for (const id of ["basis", "parties"]) drop(id);
93
- return kept.map(({ min: _min, ...column }) => column);
94
+ return markHiddenTableColumns(columns, kept.map(({ min: _min, ...column }) => column));
94
95
  }
95
96
 
96
97
  /** The date basis column as wide as its longest label on screen ("Primary completion (actual)"), never narrower than its heading. */
@@ -25,9 +25,15 @@ export function policyObservations(data: CentralBankRatesPayload): { asOf: strin
25
25
  return data.rows.filter((row) => row.status !== "unavailable").map((row) => ({ asOf: row.asOf, stale: row.status === "stale" }));
26
26
  }
27
27
 
28
+ /** Why a bank's row has no rate, or an old one; the board says it under itself while the row is selected. */
29
+ export function policyRowNote(row: CentralBankRow): string | null {
30
+ return row.status === "stale" ? `${row.label}: stale, latest observation ${row.asOf ?? "unknown"}${row.lagDays == null ? "" : ` (${row.lagDays} days old)`}.`
31
+ : row.status === "unavailable" ? `${row.label}: ${(row.unavailableReason ?? "unavailable").replaceAll("-", " ")}.` : null;
32
+ }
33
+
34
+ /** Every listed row's note, as the report lists them. */
28
35
  export function policyNotices(data: CentralBankRatesPayload): string[] {
29
- return data.rows.filter((row) => !hasNoPolicyRate(row)).flatMap((row) => row.status === "stale" ? [`${row.label}: stale, latest observation ${row.asOf ?? "unknown"}${row.lagDays == null ? "" : ` (${row.lagDays} days old)`}.`]
30
- : row.status === "unavailable" ? [`${row.label}: ${(row.unavailableReason ?? "unavailable").replaceAll("-", " ")}.`] : []);
36
+ return data.rows.filter((row) => !hasNoPolicyRate(row)).flatMap((row) => policyRowNote(row) ?? []);
31
37
  }
32
38
  export function policyHistory(row: CentralBankRow) {
33
39
  return row.history.filter((point) => (!row.percentile.windowStart || point.date >= row.percentile.windowStart)
@@ -16,7 +16,7 @@ import { getCachedCentralBankRates, loadCentralBankRates } from "./client";
16
16
  import { centralBankRatesHeadless } from "./headless";
17
17
  import { reportFooterSegment } from "../shared/source-footer";
18
18
  import {
19
- hasNoPolicyRate, policyBoardRow, policyChange, policyChangeDate, policyHistory, policyLevel, policyNotices, policyObservations, policyRate,
19
+ hasNoPolicyRate, policyBoardRow, policyChange, policyChangeDate, policyHistory, policyLevel, policyObservations, policyRate, policyRowNote,
20
20
  policySource,
21
21
  } from "./model";
22
22
 
@@ -68,7 +68,8 @@ export function CentralBankRatesPane({ width, height, focused }: PaneProps) {
68
68
  useAutoRefresh(resource.updatedAt, resource.load);
69
69
  usePaneRefreshKey(() => resource.reload(), { focused });
70
70
  usePaneNoticeFooter({ registrationId: "central-bank-rates:notices", focused,
71
- notices: [...(data ? policyNotices(data) : []), ...(resource.data?.refreshError ? [resource.data.refreshError] : [])] });
71
+ // A bank with no rate or an old one says so on its row (`rowNote`); the footer is the board's.
72
+ notices: resource.data?.refreshError ? [resource.data.refreshError] : [] });
72
73
  usePaneStatusLinkFooter({ registrationId: "central-bank-rates", focused, loading: resource.loading, error: resource.error,
73
74
  url: selected?.observation.sourceUrl ?? null, showOpenHint: true,
74
75
  // Its sources and the rows' dates, as `fn CBR` ends; how long ago it loaded goes first on a narrow row.
@@ -82,7 +83,8 @@ export function CentralBankRatesPane({ width, height, focused }: PaneProps) {
82
83
  {/* The board heads the move's date LAST CHANGE, so the move itself is MOVE. */}
83
84
  {data ? <MarketBoardStack rows={rows} width={width} height={height} focused={focused}
84
85
  selectedId={selectedId} onSelectedIdChange={setSelectedId} openId={openId} onOpenIdChange={setOpenId}
85
- valueWidth={14} changeLabel="MOVE" labelHeader="JURISDICTION" labelWidth={14} labelDetailHeader="INSTRUMENT" renderDetail={(row) => <PolicyDetail row={row.observation} width={width} height={Math.max(5, height - 2)} focused={focused} />} /> : null}
86
+ valueWidth={14} changeLabel="MOVE" labelHeader="JURISDICTION" labelWidth={14} labelDetailHeader="INSTRUMENT"
87
+ rowNote={(row) => policyRowNote(row.observation)} renderDetail={(row) => <PolicyDetail row={row.observation} width={width} height={Math.max(5, height - 2)} focused={focused} />} /> : null}
86
88
  </PaneStatusBody>
87
89
  </Box>;
88
90
  }
@@ -7,6 +7,7 @@ import {
7
7
  validateChartSpec,
8
8
  } from "../../../time-series/spec";
9
9
  import { isRecord } from "../../../utils/guards";
10
+ import type { ChartResolution, TimeRange } from "../../../time-series/range";
10
11
 
11
12
  export const CHART_SPEC_SETTING_KEY = "chartSpec";
12
13
  export const CHART_INTERACTION_VIEWPORT_SETTING_KEY = "chartInteractionViewport";
@@ -33,6 +34,10 @@ export function parseSharedPinnedMoment(value: unknown, now = Date.now()): numbe
33
34
  }
34
35
  export const MAX_CHART_COMPOSER_SERIES = MAX_CHART_SERIES;
35
36
 
37
+ export function comparisonPresetResolution(range: TimeRange): ChartResolution {
38
+ return range === "1D" ? "auto" : "1d";
39
+ }
40
+
36
41
  export interface ChartInteractionViewport {
37
42
  authoredViewportKey: string;
38
43
  start: string;
@@ -12,6 +12,7 @@ import {
12
12
  import type { ChartSeriesSpec, ChartSpec, SeriesPeriod } from "../../../time-series/types";
13
13
  import { yearToDateBaseDay } from "../../../market-data/market/year-to-date";
14
14
  import { readPriceWindow } from "../../../utils/price-window";
15
+ import { comparisonPresetResolution } from "./chart-spec";
15
16
 
16
17
  const PRICE_CAPABILITIES = new Set(["price-chart", "intraday-price-chart", "price-comparison"]);
17
18
 
@@ -67,13 +68,14 @@ export function applyChartComposerCapabilityOptions(
67
68
  let next = spec;
68
69
  if ((options.rangePreset ?? options.range) === "YTD") {
69
70
  // A year of daily bars, shown from the prior year's last close.
70
- next = { ...next, viewport: { ...next.viewport, range: "1Y", dateWindow: yearToDateWindow(next) } };
71
+ next = { ...next, viewport: { ...next.viewport, range: "1Y", dateWindow: { ...yearToDateWindow(next), endAtLatestObservation: true } } };
71
72
  }
72
73
  const selectedRange = chartRange(options);
73
74
  const range = capabilityId === "intraday-price-chart" && typeof options.session === "string"
74
75
  ? "1D"
75
76
  : selectedRange;
76
- const resolution = chartResolution(options);
77
+ const resolution = chartResolution(options)
78
+ ?? (capabilityId === "price-comparison" ? comparisonPresetResolution(range ?? next.viewport.range) : null);
77
79
  if (range || resolution) {
78
80
  next = {
79
81
  ...next,
@@ -90,10 +92,12 @@ export function applyChartComposerCapabilityOptions(
90
92
  ? readPriceWindow(typeof options.from === "string" ? options.from : undefined, typeof options.to === "string" ? options.to : undefined)
91
93
  : null;
92
94
  if (window) {
93
- next = { ...next, viewport: { ...next.viewport, range: rangeCovering(window.from), dateWindow: { start: window.from, end: window.to } } };
95
+ next = { ...next, viewport: { ...next.viewport, range: rangeCovering(window.from), dateWindow: {
96
+ start: window.from, end: window.to, ...(options.to == null ? { endAtLatestObservation: true } : {}),
97
+ } } };
94
98
  }
95
99
 
96
- if (capabilityId === "price-chart" && options.extendedHours === true) {
100
+ if ((capabilityId === "price-chart" || capabilityId === "price-comparison") && options.extendedHours === true) {
97
101
  next = { ...next, viewport: { ...next.viewport, extendedHours: true } };
98
102
  }
99
103
 
@@ -102,7 +106,7 @@ export function applyChartComposerCapabilityOptions(
102
106
  }
103
107
 
104
108
  // --currency USD: every leg converted into it at each day's FX close.
105
- if (capabilityId === "price-comparison" && typeof options.currency === "string" && /^[A-Z]{3}$/.test(options.currency)) {
109
+ if ((capabilityId === "price-comparison" || capabilityId === "fundamental-series") && typeof options.currency === "string" && /^[A-Z]{3}$/.test(options.currency)) {
106
110
  next = { ...next, viewport: { ...next.viewport, currency: options.currency } };
107
111
  }
108
112
 
@@ -4,7 +4,6 @@ import { Box } from "../../../ui";
4
4
  import {
5
5
  DataTableView,
6
6
  QueryBar,
7
- usePaneNoticeFooter,
8
7
  usePaneTabs,
9
8
  useQueryBarSearch,
10
9
  type DataTableCell,
@@ -243,11 +242,6 @@ export function DataCatalogPane({ focused, width, height }: PaneProps) {
243
242
  }
244
243
  }, []);
245
244
 
246
- usePaneNoticeFooter({
247
- registrationId: `${DATA_CATALOG_PANE_ID}:notices`,
248
- focused,
249
- notices: selectedRow?.limitation ? [`${selectedRow.label}: ${selectedRow.limitation}`] : [],
250
- });
251
245
 
252
246
  usePaneStatusLinkFooter({
253
247
  registrationId: DATA_CATALOG_PANE_ID,
@@ -315,6 +309,8 @@ export function DataCatalogPane({ focused, width, height }: PaneProps) {
315
309
  getItemKey={(row) => row.id}
316
310
  onActivate={chartSelected}
317
311
  renderCell={renderCell}
312
+ // A series' limitation is its row's, under the table while it is selected; the footer is the catalog's.
313
+ rowNote={(row) => row.limitation ? `${row.label}: ${row.limitation}` : null}
318
314
  selectedTextOverridesCellColor
319
315
  emptyStateTitle={emptyCopy.title}
320
316
  emptyStateHint={emptyCopy.hint}
@@ -5,6 +5,7 @@ import { FINANCIAL_PERIOD_OPTION, FINANCIAL_PERIOD_COUNT_OPTION, HISTORY_RANGE_V
5
5
  import { DATE_OPTION_EXAMPLES } from "../../../utils/calendar-date";
6
6
  import { PRICE_WINDOW_FROM_HELP, PRICE_WINDOW_TO_HELP } from "../../../utils/price-window";
7
7
  import { isCurrencyCode } from "../../../utils/currency-pair";
8
+ import { STATEMENT_CURRENCY_OPTION } from "../shared/statement-currency";
8
9
 
9
10
  type PaneSchema = Pick<HeadlessPaneDefinition, "argument" | "options" | "discovery">;
10
11
 
@@ -17,6 +18,13 @@ const FUNDAMENTAL_PERIOD_OPTION: HeadlessPaneOptionDef = { ...FINANCIAL_PERIOD_O
17
18
 
18
19
  const BAR_SIZES = CHART_BAR_SIZE_PRESETS.map((value) => ({ value }));
19
20
 
21
+ const EXTENDED_HOURS_OPTION = {
22
+ key: "extendedHours",
23
+ description: "Include pre-market and after-hours bars on an intraday chart of a US listing.",
24
+ type: "boolean" as const,
25
+ defaultValue: false,
26
+ };
27
+
20
28
  const BAR_SIZE_DESCRIPTION = "Bar size: any count of minutes, hours, days, weeks or months; one the source does not serve is built from its shorter bars";
21
29
 
22
30
  /**
@@ -85,12 +93,7 @@ export const paneSchemas = {
85
93
  values: HISTORY_RANGE_VALUES,
86
94
  defaultValue: "5Y",
87
95
  },
88
- {
89
- key: "extendedHours",
90
- description: "Include pre-market and after-hours bars on an intraday chart of a US listing.",
91
- type: "boolean",
92
- defaultValue: false,
93
- },
96
+ EXTENDED_HOURS_OPTION,
94
97
  ],
95
98
  discovery: {
96
99
  id: "price-chart",
@@ -136,7 +139,7 @@ export const paneSchemas = {
136
139
  options: [
137
140
  {
138
141
  key: "rangePreset",
139
- description: "Price-history window. YTD runs from the prior year's last close.",
142
+ description: "Price-history window. 1D compares intraday bars in the latest session; YTD runs from the prior year's last close.",
140
143
  type: "enum",
141
144
  aliases: ["range"],
142
145
  values: RETURN_RANGE_VALUES,
@@ -172,19 +175,19 @@ export const paneSchemas = {
172
175
  },
173
176
  {
174
177
  key: "chartResolution",
175
- description: BAR_SIZE_DESCRIPTION,
178
+ description: `${BAR_SIZE_DESCRIPTION}. Defaults to intraday for 1D and daily otherwise`,
176
179
  type: "enum",
177
180
  aliases: ["resolution"],
178
181
  values: BAR_SIZES,
179
- defaultValue: "1d",
180
182
  normalize: (value) => normalizeBarSize(value, false),
181
183
  },
184
+ EXTENDED_HOURS_OPTION,
182
185
  ],
183
186
  discovery: {
184
187
  id: "price-comparison",
185
188
  aliases: ["stock comparison", "price performance comparison", "returns comparison", "compare stock prices", "hedged vs unhedged",
186
189
  "currency hedged"],
187
- limitations: ["Compares closing-price changes over shared observation dates, in each listing's currency unless currency is set, which converts each close at that day's FX close. Cash distributions are excluded unless totalReturn is set, which reinvests each distribution at its ex-date close."],
190
+ limitations: ["Compares price changes over shared bar times for 1D and shared observation dates for daily bars. Uses each listing's currency unless currency is set, which converts each bar at that day's FX close. Cash distributions are excluded unless totalReturn is set, which reinvests each distribution at its ex-date close."],
188
191
  screenshotReadiness: "ready",
189
192
  },
190
193
  },
@@ -217,6 +220,7 @@ export const paneSchemas = {
217
220
  },
218
221
  FUNDAMENTAL_PERIOD_OPTION,
219
222
  FINANCIAL_PERIOD_COUNT_OPTION,
223
+ STATEMENT_CURRENCY_OPTION,
220
224
  ],
221
225
  discovery: {
222
226
  id: "fundamental-series",
@@ -34,6 +34,7 @@ import { uncoveredCapabilityMessage } from "../../../capabilities/chart-series";
34
34
  import { loadFuturesContractTerms, loadFuturesPriceUnit } from "../../../market-data/futures-contract";
35
35
  import { formulaContractNote, formulaRollNote } from "../../../time-series/studies/formula";
36
36
  import { loadDailyFxCloses } from "../../../time-series/currency-conversion";
37
+ import { loadStatementCurrency } from "../shared/statement-currency";
37
38
  import { canonicalExchange, isKnownExchangeCode, isUsListingExchange, parsePublicTickerKey, publicTickerKey } from "../../../utils/exchanges";
38
39
  import { zonedDateKey, zonedDateTimeParts } from "../../../utils/zoned-date-time";
39
40
  import { futuresSessionOpenMinute } from "../../../market-data/market/trading-sessions";
@@ -162,6 +163,7 @@ export async function loadChartPaneModel(
162
163
  loadFuturesPriceUnit: (symbol) => loadFuturesPriceUnit(symbol, (key) => loadFuturesContractTerms(key, context.apiClient)),
163
164
  loadEarningsHistory: (symbol) => context.apiClient.getCloudEarningsHistory(symbol, 100),
164
165
  loadFxCloses: (currency, startDate) => loadDailyFxCloses(currency, startDate, context.apiClient),
166
+ loadStatementCurrency: (target, currencies) => loadStatementCurrency(target, currencies, context),
165
167
  loadFredSeries: async (request) => ({
166
168
  data: await context.apiClient.getCloudFredSeries(request.seriesId, {
167
169
  startDate: request.startDate,
@@ -30,6 +30,8 @@ import {
30
30
  import {
31
31
  CHART_DRAWINGS_SETTING_KEY,
32
32
  parseChartDrawings,
33
+ parseSharedChartDrawings,
34
+ shareableChartDrawings,
33
35
  type ChartDrawing,
34
36
  } from "../../../components/chart/composite/tools";
35
37
  import {
@@ -191,10 +193,20 @@ function pinChartSpecListings(spec: ChartSpec, tickers: ReadonlyMap<string, Tick
191
193
  return changed ? { ...spec, series } : spec;
192
194
  }
193
195
 
196
+ /** The pane with only the drawings a link carries: the newest that fit, none this build cannot read. */
197
+ function withShareableDrawings(pane: PaneInstanceConfig): PaneInstanceConfig {
198
+ const saved = pane.settings?.[CHART_DRAWINGS_SETTING_KEY];
199
+ if (saved === undefined) return pane;
200
+ const { [CHART_DRAWINGS_SETTING_KEY]: _saved, ...settings } = pane.settings!;
201
+ const drawings = shareableChartDrawings(parseChartDrawings(saved));
202
+ return { ...pane, settings: drawings.length > 0 ? { ...settings, [CHART_DRAWINGS_SETTING_KEY]: drawings } : settings };
203
+ }
204
+
194
205
  function prepareChartPaneForShare(
195
- pane: PaneInstanceConfig,
206
+ saved: PaneInstanceConfig,
196
207
  { tickers, pinnedTime }: { tickers: ReadonlyMap<string, TickerRecord>; pinnedTime?: number },
197
208
  ): PaneInstanceConfig {
209
+ const pane = withShareableDrawings(saved);
198
210
  // A crosshair pinned in the sender's tab travels with the link, so it opens
199
211
  // on that moment. A moment the pane still holds from a link it was opened
200
212
  // from is never passed on, whatever else the pane holds.
@@ -333,7 +345,7 @@ const chartComposerTemplates: PaneTemplateDef[] = [
333
345
  const sharedData = isRecord(options?.shareData) ? options.shareData : null;
334
346
  const sharedSpec = parseChartSpec(sharedData?.chartSpec ?? options?.shareData);
335
347
  if (sharedSpec) {
336
- const drawings = parseChartDrawings(sharedData?.chartDrawings);
348
+ const drawings = parseSharedChartDrawings(sharedData?.chartDrawings) ?? [];
337
349
  const viewport = parseChartInteractionViewport(sharedData?.chartInteractionViewport);
338
350
  return instanceFor(sharedSpec, "G", {
339
351
  ...(drawings.length > 0 ? { drawings } : {}),
@@ -349,7 +361,7 @@ const chartComposerTemplates: PaneTemplateDef[] = [
349
361
  if (!spec) return null;
350
362
  if (spec.series.some((series) => series.source.kind === "security"
351
363
  && (series.source.instrument.instrument || series.source.instrument.brokerId || series.source.instrument.brokerInstanceId))) return null;
352
- const drawings = parseChartDrawings(pane.settings?.[CHART_DRAWINGS_SETTING_KEY]);
364
+ const drawings = shareableChartDrawings(parseChartDrawings(pane.settings?.[CHART_DRAWINGS_SETTING_KEY]));
353
365
  const viewport = parseChartInteractionViewport(
354
366
  pane.settings?.[CHART_INTERACTION_VIEWPORT_SETTING_KEY],
355
367
  );
@@ -370,8 +382,8 @@ const chartComposerTemplates: PaneTemplateDef[] = [
370
382
  ].includes(key))) return null;
371
383
  const spec = parseChartSpec(data.chartSpec);
372
384
  if (!spec) return null;
373
- const drawings = parseChartDrawings(data.chartDrawings);
374
- if (data.chartDrawings !== undefined && (!Array.isArray(data.chartDrawings) || (data.chartDrawings.length > 0 && drawings.length === 0))) return null;
385
+ const drawings = data.chartDrawings === undefined ? [] : parseSharedChartDrawings(data.chartDrawings);
386
+ if (!drawings) return null;
375
387
  const viewport = data.chartInteractionViewport === undefined
376
388
  ? null
377
389
  : parseChartInteractionViewport(data.chartInteractionViewport);
@@ -20,6 +20,7 @@ import {
20
20
  type MultiSelectRowAction,
21
21
  } from "../../../components/ui";
22
22
  import { CompositeChart } from "../../../components/chart/composite";
23
+ import { useCaptureDatesData } from "../../../components/layout/pane/capture-status";
23
24
  import { savedCopyFooterInfo } from "../../../components/layout/pane/footer";
24
25
  import { useChartViewReset, useChartViewResetListener } from "../../../components/chart/core/view-reset";
25
26
  import { formatCompositeDatasetDate } from "../../../components/chart/composite/format";
@@ -64,6 +65,7 @@ import { getTimeSeriesField, isMarketFieldId } from "../../../time-series/field-
64
65
  import { isDatasetChart, isOhlcSeriesStyle } from "../../../time-series/spec";
65
66
  import { useThemeColors } from "../../../theme/theme-context";
66
67
  import { comparisonLegCurrencies, priceComparisonSeriesIds } from "../../../time-series/price-comparison";
68
+ import { periodDayText } from "../../../market-data/market/period-return";
67
69
  import { companyLegendLabels } from "./legend-names";
68
70
  import { seriesMessageName, studyMessageName } from "../../../time-series/series-name";
69
71
  import { CHART_COMPOSER_PANE_ID } from "../../../types/config";
@@ -120,7 +122,7 @@ import {
120
122
  type PairStudySelection,
121
123
  } from "./studies";
122
124
  import { buildEmptyChartPreset, buildPriceChartPreset } from "./presets";
123
- import type { ChartInteractionViewport } from "./chart-spec";
125
+ import { comparisonPresetResolution, type ChartInteractionViewport } from "./chart-spec";
124
126
  import {
125
127
  CHART_FORMULA_OPTIONS,
126
128
  CHART_BAR_SIZE_PRESETS,
@@ -962,14 +964,18 @@ function ChartComposerSurface({
962
964
  /** The range the bar shows as selected; a fixed window or a period count leaves a range to pick. */
963
965
  const rangeReselects = !spec.viewport.dateWindow && spec.viewport.maxPoints === undefined;
964
966
  const setRange = useCallback((range: TimeRange) => {
967
+ const current = spec.viewport;
968
+ const changesSession = range === "1D" ? current.resolution === "1d"
969
+ : current.range === "1D" && current.resolution === "auto";
970
+ const resolution = changesSession && priceComparisonSeriesIds(spec) ? comparisonPresetResolution(range) : current.resolution;
965
971
  // The range already showing: a view moved off it goes back to it, as `0` does.
966
- if (rangeReselects && range === spec.viewport.range) {
972
+ if (rangeReselects && range === current.range && resolution === current.resolution) {
967
973
  resetChartView();
968
974
  return;
969
975
  }
970
976
  setSpec({
971
977
  ...spec,
972
- viewport: { ...spec.viewport, range, dateWindow: undefined, maxPoints: undefined },
978
+ viewport: { ...current, range, resolution, dateWindow: undefined, maxPoints: undefined },
973
979
  });
974
980
  }, [rangeReselects, resetChartView, setSpec, spec]);
975
981
  const setResolution = useCallback((next: ChartResolution) => {
@@ -1217,8 +1223,14 @@ function ChartComposerSurface({
1217
1223
  const timeZone = exchange?.kind === "security"
1218
1224
  ? intradaySessionTimeZone(exchange.instrument.symbol, exchange.instrument.exchange)
1219
1225
  : "UTC";
1220
- return formatChartDateWindow(window, timeZone);
1221
- }, [spec.series, spec.viewport.dateWindow]);
1226
+ const end = window.endAtLatestObservation && viewport?.end
1227
+ ? /^\d{4}-\d{2}-\d{2}$/.test(window.end) ? viewport.end.toISOString().slice(0, 10) : viewport.end.toISOString()
1228
+ : window.end;
1229
+ return formatChartDateWindow({ ...window, end }, timeZone);
1230
+ }, [spec.series, spec.viewport.dateWindow, viewport?.end]);
1231
+ const comparisonEnd = resolution.resolution === "1d" ? Object.values(resolution.priceComparison?.legs ?? {})[0] : undefined;
1232
+ const comparisonAsOf = comparisonEnd && `${periodDayText(comparisonEnd.endDay, new Date().getUTCFullYear())} ${comparisonEnd.intraday ? "partial" : "close"}`;
1233
+ const captureDatesData = useCaptureDatesData();
1222
1234
 
1223
1235
  // A generic future (CL1) is a rolling series: its roll rule and adjustment are chart controls.
1224
1236
  const generic = useMemo(() => chartFuturesGeneric(spec), [spec]);
@@ -1323,7 +1335,8 @@ function ChartComposerSurface({
1323
1335
  options: resolutionOptions,
1324
1336
  onChange: (value: string) => setResolution(value as ChartResolution),
1325
1337
  } : undefined}
1326
- meta={dateWindowLabel}
1338
+ asOf={comparisonAsOf}
1339
+ meta={[dateWindowLabel, captureDatesData && comparisonAsOf].filter(Boolean).join(" · ") || undefined}
1327
1340
  />
1328
1341
  <MultiSelectDialogButton
1329
1342
  ref={indicatorsDialogRef}
@@ -1,5 +1,5 @@
1
1
  import type { ChartResolution } from "../../../components/chart/core/types";
2
- import { chartBarSizeParts, isManualChartResolution, type ManualChartResolution } from "../../../time-series/resolution";
2
+ import { chartBarSizeName, chartBarSizeParts, isManualChartResolution, type ManualChartResolution } from "../../../time-series/resolution";
3
3
 
4
4
  const RESOLUTION_LABELS: Record<ManualChartResolution | "auto", string> = {
5
5
  auto: "Auto",
@@ -14,21 +14,8 @@ const RESOLUTION_LABELS: Record<ManualChartResolution | "auto", string> = {
14
14
  "1mo": "M",
15
15
  };
16
16
 
17
- const RESOLUTION_NAMES: Record<ManualChartResolution, string> = {
18
- "1m": "1-minute",
19
- "5m": "5-minute",
20
- "15m": "15-minute",
21
- "30m": "30-minute",
22
- "45m": "45-minute",
23
- "1h": "hourly",
24
- "1d": "daily",
25
- "1wk": "weekly",
26
- "1mo": "monthly",
27
- };
28
-
29
17
  // Months take MO beyond one (3MO), as 3M and 6M are ranges in the same bar.
30
18
  const BUILT_UNIT_LABELS = { m: "m", h: "h", d: "D", wk: "W", mo: "MO" } as const;
31
- const BUILT_UNIT_NAMES = { m: "minute", h: "hour", d: "day", wk: "week", mo: "month" } as const;
32
19
 
33
20
  /**
34
21
  * The one way chart intervals are labelled. Intraday reads in lowercase units
@@ -44,9 +31,7 @@ export function formatChartResolution(resolution: ChartResolution): string {
44
31
 
45
32
  export function describeChartResolution(resolution: ChartResolution): string {
46
33
  if (resolution === "auto") return "Choose an interval automatically for the active range.";
47
- if (isManualChartResolution(resolution)) return `Use ${RESOLUTION_NAMES[resolution]} observations.`;
48
- const parts = chartBarSizeParts(resolution);
49
- return parts ? `Use ${parts.count}-${BUILT_UNIT_NAMES[parts.unit]} observations.` : `Use ${resolution} observations.`;
34
+ return `Use ${chartBarSizeName(resolution)} observations.`;
50
35
  }
51
36
 
52
37
  function calendarParts(date: Date, timeZone: string): { key: string; year: number; label: string } {
@@ -167,6 +167,7 @@ export class ChatNotificationAlerts {
167
167
  body,
168
168
  type: "info",
169
169
  desktop: "when-inactive",
170
+ browser: true,
170
171
  ...(openMessage ? {
171
172
  action: {
172
173
  label: "Open",
@@ -178,7 +178,6 @@ export const chatModule: PluginModule = {
178
178
  chatController.attachPersistence(ctx.persistence, ctx.resume);
179
179
  chatSidebarStore.attach(ctx.persistence);
180
180
  chatHandlePromptStore.attach(ctx.persistence);
181
- // The desktop app's Dock badge counts the people who wrote to you or tagged you, plus the missed notices; other hosts have no badge.
182
181
  disposeUnreadBadge?.();
183
182
  const badgeHost = getAppBadgeHost();
184
183
  disposeUnreadBadge = badgeHost
@@ -35,9 +35,14 @@ function openAuth(
35
35
  const RESEND_VERIFICATION = "Resend Verification Email";
36
36
 
37
37
  /**
38
- * The account actions as buttons: Log in and Sign up free, or the resend for
38
+ * The account actions as buttons: Sign up free and Log in, or the resend for
39
39
  * an unconfirmed address. One look for the wall and for the inline copy, so
40
40
  * the same action never reads as two different controls.
41
+ *
42
+ * Where both show, Sign up free leads and is the primary: most people who
43
+ * meet a wall have no account yet, and a Log in form is a dead end for them.
44
+ * Log in stays beside it. A surface that offers Log in alone (a saved login)
45
+ * keeps it as its primary.
41
46
  */
42
47
  function AuthButtons({ showSignup, needsVerification, onAuth, onResend, stopPropagation = false }: {
43
48
  showSignup: boolean;
@@ -50,8 +55,8 @@ function AuthButtons({ showSignup, needsVerification, onAuth, onResend, stopProp
50
55
  if (needsVerification) return <Button label={t(RESEND_VERIFICATION)} stopPropagation={stopPropagation} onPress={onResend} />;
51
56
  return (
52
57
  <>
53
- <Button label={t("Log in")} variant="primary" stopPropagation={stopPropagation} onPress={() => onAuth("login")} />
54
- {showSignup && <Button label={t("Sign up free")} variant="secondary" stopPropagation={stopPropagation} onPress={() => onAuth("signup")} />}
58
+ {showSignup && <Button label={t("Sign up free")} variant="primary" stopPropagation={stopPropagation} onPress={() => onAuth("signup")} />}
59
+ <Button label={t("Log in")} variant={showSignup ? "secondary" : "primary"} stopPropagation={stopPropagation} onPress={() => onAuth("login")} />
55
60
  </>
56
61
  );
57
62
  }
@@ -79,17 +84,17 @@ export function InlineAuthActions({ showSignup = true, needsVerification = false
79
84
  usePaneMenuItems(`inline-auth:${useId()}`, () => needsVerification
80
85
  ? [{ id: "resend-verification", label: t(RESEND_VERIFICATION), onSelect: resend }]
81
86
  : [
82
- { id: "log-in", label: t("Log in"), onSelect: logIn },
83
87
  ...(showSignup ? [{ id: "sign-up", label: t("Sign up free"), onSelect: signUp }] : []),
88
+ { id: "log-in", label: t("Log in"), onSelect: logIn },
84
89
  ], [openCommandBar, needsVerification, showSignup]);
85
90
  if (variant === "plain") {
86
91
  return (
87
92
  <Box flexDirection="row">
88
- <Button label={t("Log in")} variant="plain" compact stopPropagation onPress={logIn} />
89
93
  {showSignup && <>
90
- <Text fg={colors.textDim}> / </Text>
91
94
  <Button label={t("Sign up free")} variant="plain" compact stopPropagation onPress={signUp} />
95
+ <Text fg={colors.textDim}> / </Text>
92
96
  </>}
97
+ <Button label={t("Log in")} variant="plain" compact stopPropagation onPress={logIn} />
93
98
  </Box>
94
99
  );
95
100
  }
@@ -577,13 +577,15 @@ export function CompanyPicker({
577
577
  /**
578
578
  * Mounted next to the onboarding. Opens once per session, when a brand-new
579
579
  * account is signed in with only the seeded lists and the onboarding is not
580
- * running.
580
+ * running. It waits for an open command bar to close: the card takes every
581
+ * key, so what the user was typing there would go nowhere.
581
582
  */
582
583
  export function CompanyPickerHost({ pluginRegistry }: { pluginRegistry: PluginRegistry }) {
583
584
  const dispatch = useAppDispatch();
584
585
  const stateRef = useAppStateRef();
585
586
  const toast = useToastHost();
586
587
  const onboardingDone = useAppSelector((state) => state.config.onboardingComplete && !state.config.onboardingProgress);
588
+ const commandBarOpen = useAppSelector((state) => state.commandBarOpen);
587
589
  const [user, setUser] = useState<AuthUser | null>(() => apiClient.getCurrentUser());
588
590
  const [open, setOpen] = useState(false);
589
591
  const askedRef = useRef(false);
@@ -591,12 +593,12 @@ export function CompanyPickerHost({ pluginRegistry }: { pluginRegistry: PluginRe
591
593
  useEffect(() => apiClient.subscribeCurrentUser(() => setUser(apiClient.getCurrentUser())), []);
592
594
 
593
595
  useEffect(() => {
594
- if (askedRef.current || !onboardingDone || !isNewAccount(user)) return;
596
+ if (askedRef.current || !onboardingDone || commandBarOpen || !isNewAccount(user)) return;
595
597
  const watchlistId = stateRef.current.config.watchlists[0]?.id;
596
598
  if (!needsCompanyPicks(stateRef.current.tickers.values(), watchlistId)) return;
597
599
  askedRef.current = true;
598
600
  setOpen(true);
599
- }, [onboardingDone, stateRef, user]);
601
+ }, [commandBarOpen, onboardingDone, stateRef, user]);
600
602
 
601
603
  const searchCompanies = useCallback<SearchCompanies>(
602
604
  (query) => pluginRegistry.marketData.search(query),
@@ -24,7 +24,7 @@ export function registerCloudUpgradeCommand(ctx: GloomPluginContext): void {
24
24
  };
25
25
  if (!apiClient.isSignedIn()) {
26
26
  // Upgrading needs an account first; continue to checkout once signed in.
27
- if (!requestAuthDialog({ mode: "signup", onSignedIn: openUpgrade })) {
27
+ if (!requestAuthDialog({ mode: "signup", onSignedIn: openUpgrade, checkout: true })) {
28
28
  ctx.openCommandBar("Sign Up");
29
29
  }
30
30
  return;
@@ -57,7 +57,7 @@ const TAB_ELSEWHERE: Readonly<Record<string, string>> = {
57
57
  const TAB_REPORT_OPTION: PaneReportOptionDef = {
58
58
  key: "tab",
59
59
  type: "enum",
60
- description: "The board to open on: futures markets, EIA inventories, CFTC positioning or USDA crop balances.",
60
+ description: "The board to open on: futures markets, EIA inventories, COT positioning or USDA crop balances.",
61
61
  values: [{ value: "markets" }, { value: "inventories" }, { value: "positioning" }, { value: "crops" }],
62
62
  example: "--tab inventories",
63
63
  exampleWithoutArgument: true,