@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
@@ -0,0 +1,103 @@
1
+ import type { AppNotificationRequest, PaneSettingsDef } from "../../types/plugin";
2
+ import { logFailure } from "../../utils/log-failure";
3
+ import { isBrowserAppActive } from "./activity";
4
+
5
+ const PREFERENCE_KEY = "gloomberb:browser-notifications";
6
+
7
+ interface NotificationApi {
8
+ new(title: string, options: NotificationOptions): Pick<Notification, "onclick" | "close">;
9
+ readonly permission: NotificationPermission;
10
+ requestPermission(): Promise<NotificationPermission>;
11
+ }
12
+
13
+ interface BrowserNotificationOptions {
14
+ getApi?: () => NotificationApi | undefined;
15
+ getStorage?: () => Pick<Storage, "getItem" | "setItem" | "removeItem">;
16
+ isActive?: () => boolean;
17
+ focus?: () => void;
18
+ }
19
+
20
+ export function createBrowserNotifications({
21
+ getApi = () => typeof globalThis.Notification?.requestPermission === "function" ? globalThis.Notification : undefined,
22
+ getStorage = () => window.localStorage,
23
+ isActive = isBrowserAppActive,
24
+ focus = () => window.focus(),
25
+ }: BrowserNotificationOptions = {}) {
26
+ function isEnabled(): boolean {
27
+ try {
28
+ return getApi()?.permission === "granted" && getStorage().getItem(PREFERENCE_KEY) === "1";
29
+ } catch (error) {
30
+ logFailure("browser-notifications", "Could not read the browser notification preference")(error);
31
+ return false;
32
+ }
33
+ }
34
+
35
+ async function setEnabled(enabled: boolean): Promise<"changed" | "denied" | "dismissed" | "unavailable"> {
36
+ try {
37
+ const storage = getStorage();
38
+ if (!enabled) {
39
+ storage.removeItem(PREFERENCE_KEY);
40
+ return "changed";
41
+ }
42
+ const api = getApi();
43
+ if (!api) return "unavailable";
44
+ const permission = api.permission === "default" ? await api.requestPermission() : api.permission;
45
+ if (permission === "denied") return "denied";
46
+ if (permission !== "granted") return "dismissed";
47
+ storage.setItem(PREFERENCE_KEY, "1");
48
+ return "changed";
49
+ } catch (error) {
50
+ logFailure("browser-notifications", "Could not change the browser notification preference")(error);
51
+ return "unavailable";
52
+ }
53
+ }
54
+
55
+ function notify(request: AppNotificationRequest): boolean {
56
+ const api = getApi();
57
+ if (!api || isActive() || !isEnabled() || !request.body.trim()) return false;
58
+ try {
59
+ const banner = new api(request.title?.trim() || "Gloom", {
60
+ body: [request.subtitle, request.body].filter(Boolean).join("\n"),
61
+ tag: request.refId,
62
+ silent: true,
63
+ });
64
+ banner.onclick = () => {
65
+ focus();
66
+ banner.close();
67
+ request.action?.onClick();
68
+ };
69
+ return true;
70
+ } catch (error) {
71
+ logFailure("browser-notifications", "Could not show a browser notification")(error);
72
+ return false;
73
+ }
74
+ }
75
+
76
+ return { isSupported: () => !!getApi(), isEnabled, setEnabled, notify };
77
+ }
78
+
79
+ export const browserNotifications = createBrowserNotifications();
80
+
81
+ export function browserChatSettings(): PaneSettingsDef {
82
+ if (!browserNotifications.isSupported()) return { fields: [] };
83
+ const enabled = browserNotifications.isEnabled();
84
+ return {
85
+ fields: [{
86
+ key: "browserNotifications",
87
+ type: "action",
88
+ actionId: "browser.notifications",
89
+ label: "Browser notifications",
90
+ description: "Alerts when this tab is in the background.",
91
+ actionLabel: enabled ? "Turn off" : "Turn on",
92
+ async action({ setRowNote, notify }) {
93
+ const result = await browserNotifications.setEnabled(!browserNotifications.isEnabled());
94
+ if (result === "changed") return;
95
+ const status = result === "denied" ? "Blocked" : result === "dismissed" ? "Not enabled" : "Unavailable";
96
+ const text = result === "denied" ? "Allow notifications in your browser’s site settings." : undefined;
97
+ if (!setRowNote?.({ status, text, tone: "warning" })) {
98
+ notify({ title: "Browser notifications", body: text ?? status });
99
+ }
100
+ },
101
+ }],
102
+ };
103
+ }
@@ -2,6 +2,8 @@
2
2
  import type { RendererHost, UiHost } from "../../ui/host";
3
3
  import { safeExternalUrl } from "../../utils/external-url";
4
4
  import { createDomUiHost } from "../dom/dom-ui-host";
5
+ import { subscribeBrowserAppActivity } from "./activity";
6
+ import { browserNotifications } from "./notifications";
5
7
 
6
8
  export const browserUiHost: UiHost = createDomUiHost("browser", {
7
9
  nativePaneChrome: true,
@@ -16,6 +18,8 @@ export const browserRendererHost: RendererHost = {
16
18
  requestExit() {},
17
19
  canExit: false,
18
20
  notify() {},
21
+ notifyInBackground: browserNotifications.notify,
22
+ subscribeAppActivity: subscribeBrowserAppActivity,
19
23
  async openExternal(rawUrl) {
20
24
  const url = safeExternalUrl(rawUrl);
21
25
  if (!url) return;
@@ -15,6 +15,7 @@ import {
15
15
  } from "../../types/config";
16
16
  import type { DesktopSharedStateSnapshot, OtherWindowTab } from "../../types/desktop-window";
17
17
  import { MAIN_WINDOW_ID, type ExtraWindowRecord } from "./screen-setup";
18
+ import { applyProfileEdits, diffProfile, type ProfileJson } from "../../data/profile-merge";
18
19
 
19
20
  /**
20
21
  * Every full desktop window shows its own layout tabs from one shared config.
@@ -320,6 +321,18 @@ function inSentOrder(layouts: SavedLayout[], sentIds: readonly string[], owns: (
320
321
  return reordered;
321
322
  }
322
323
 
324
+ /**
325
+ * The plugins' settings with what a window changed in them since `before`,
326
+ * value by value, the window's value winning where both changed one: an
327
+ * alert another window or a `gloom` command added since stays when this
328
+ * window's alert check rewrote the same list.
329
+ */
330
+ function mergedPluginConfig(shared: AppConfig["pluginConfig"], before: AppConfig["pluginConfig"], after: AppConfig["pluginConfig"]): AppConfig["pluginConfig"] {
331
+ if (deepEqual(shared, before)) return after;
332
+ const json = (value: AppConfig["pluginConfig"]) => JSON.parse(JSON.stringify(value ?? {})) as ProfileJson;
333
+ return applyProfileEdits(json(shared), diffProfile(json(before), json(after)), { conflicts: "take" }) as AppConfig["pluginConfig"];
334
+ }
335
+
323
336
  /**
324
337
  * Applies what `windowId` sent on top of the shared state, counting only what
325
338
  * changed since `base`, the state the window drew from. Settings and lists
@@ -349,6 +362,7 @@ export function mergeWindowSnapshot(
349
362
  for (const key of new Set([...Object.keys(afterRecord), ...Object.keys(beforeRecord)])) {
350
363
  if (LAYOUT_KEYS.has(key) || deepEqual(afterRecord[key], beforeRecord[key])) continue;
351
364
  if (afterRecord[key] === undefined) delete configRecord[key];
365
+ else if (key === "pluginConfig") configRecord[key] = mergedPluginConfig(state.config.pluginConfig, before.config.pluginConfig, after.config.pluginConfig);
352
366
  else configRecord[key] = afterRecord[key];
353
367
  }
354
368
 
@@ -27,6 +27,7 @@ import {
27
27
  buildTableGridTemplateColumns,
28
28
  getTableWidth,
29
29
  hasMeaningfulTableHorizontalOverflow,
30
+ hiddenTableColumnText,
30
31
  tableFreezesFirstColumn,
31
32
  } from "../../../components/ui/table-layout";
32
33
  import { WEB_CELL_HEIGHT, WEB_CELL_WIDTH } from "../../../theme/font-scale";
@@ -61,12 +62,12 @@ const OVERFLOW_FADE_PX = 28;
61
62
  * rather than as a mask on it so the vertical scrollbar stays crisp. The
62
63
  * header band fades into the header colour and the rows into the table's.
63
64
  */
64
- function overflowFadeStyle(side: "left" | "right", offsetPx: number, bottomPx: number): CSSProperties {
65
+ function overflowFadeStyle(side: "left" | "right", offsetPx: number, bottomPx: number, topPx: number): CSSProperties {
65
66
  const direction = side === "left" ? "to left" : "to right";
66
67
  const headerPx = tableHeaderPx();
67
68
  return {
68
69
  position: "absolute",
69
- top: 0,
70
+ top: topPx,
70
71
  bottom: bottomPx,
71
72
  [side]: offsetPx,
72
73
  width: OVERFLOW_FADE_PX,
@@ -345,6 +346,8 @@ export function WebDataTable<T, C extends DataTableColumn = DataTableColumn>({
345
346
  }, [bodyHorizontal.bar, headerHorizontal.bar, horizontalScrollEnabled]);
346
347
 
347
348
  const overflowEdges = useHorizontalScrollEdges(bodyElementRef, [horizontalScrollEnabled]);
349
+ const hiddenColumns = items.length ? hiddenTableColumnText(columns) : null;
350
+ const disclosureHeight = hiddenColumns ? headerPx : 0;
348
351
  // A frozen first column already covers what scrolls under it, so the left
349
352
  // fade starts past it and its gap.
350
353
  const [frozenEdgePx, setFrozenEdgePx] = useState(0);
@@ -398,6 +401,11 @@ export function WebDataTable<T, C extends DataTableColumn = DataTableColumn>({
398
401
 
399
402
  return (
400
403
  <div data-gloom-role="data-table" style={rootStyle}>
404
+ {hiddenColumns ? <div style={{ flex: `0 0 ${disclosureHeight}px`, lineHeight: `${disclosureHeight}px`,
405
+ paddingInline: "var(--gloom-space-sm)", color: CSS_TEXT_DIM,
406
+ backgroundColor: CSS_PANEL, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }} title={hiddenColumns}>
407
+ {hiddenColumns}
408
+ </div> : null}
401
409
  <div
402
410
  ref={bodyElementRef}
403
411
  data-gloom-role="data-table-body-scroll"
@@ -546,16 +554,31 @@ export function WebDataTable<T, C extends DataTableColumn = DataTableColumn>({
546
554
  <div
547
555
  data-gloom-role="data-table-overflow-fade"
548
556
  data-gloom-edge="left"
549
- style={overflowFadeStyle("left", frozenEdgePx, overflowEdges.scrollbarBottom)}
557
+ style={overflowFadeStyle("left", frozenEdgePx, overflowEdges.scrollbarBottom, disclosureHeight)}
550
558
  />
551
559
  ) : null}
552
560
  {horizontalScrollEnabled && overflowEdges.end ? (
553
561
  <div
554
562
  data-gloom-role="data-table-overflow-fade"
555
563
  data-gloom-edge="right"
556
- style={overflowFadeStyle("right", overflowEdges.scrollbarRight, overflowEdges.scrollbarBottom)}
564
+ style={overflowFadeStyle("right", overflowEdges.scrollbarRight, overflowEdges.scrollbarBottom, disclosureHeight)}
557
565
  />
558
566
  ) : null}
567
+ {horizontalScrollEnabled && overflowEdges.end && items.length ? (
568
+ <button type="button" aria-label="Show more columns" onClick={() => {
569
+ const body = bodyElementRef.current;
570
+ if (!body) return;
571
+ focusPane();
572
+ const bounds = body.getBoundingClientRect();
573
+ const visibleRight = bounds.left + body.clientWidth;
574
+ const next = [...body.querySelectorAll<HTMLElement>('[data-gloom-role="data-table-header-cell"]')]
575
+ .map((cell) => cell.getBoundingClientRect()).find((cell) => cell.right > visibleRight + 1 && cell.left > bounds.left + frozenEdgePx + 1);
576
+ body.scrollLeft += next ? next.left - bounds.left - frozenEdgePx : body.clientWidth - frozenEdgePx;
577
+ }} style={{ position: "absolute", insetInlineEnd: overflowEdges.scrollbarRight, top: disclosureHeight, zIndex: 4,
578
+ cursor: "pointer", border: 0, height: headerPx, background: CSS_PANEL, color: CSS_TEXT_DIM, font: "inherit" }}>
579
+ More
580
+ </button>
581
+ ) : null}
559
582
  </div>
560
583
  );
561
584
  }
@@ -410,6 +410,8 @@ function WebDataTableRowInner<
410
410
  data-gloom-cell-instant={cell.value instanceof Date && Number.isFinite(cell.value.getTime()) ? cell.value.toISOString() : undefined}
411
411
  // The full-precision number behind a rounded cell (a trade of -9.4596 for -9.45963753), for the same reports.
412
412
  data-gloom-cell-value={typeof cell.value === "number" && Number.isFinite(cell.value) ? String(cell.value) : undefined}
413
+ // A value this row is still waiting on (DataTableCell.mayBeBlank): its blank is no lost data.
414
+ data-gloom-cell-may-be-blank={cell.mayBeBlank ? "true" : undefined}
413
415
  style={{
414
416
  minWidth: 0,
415
417
  position: freezeFirstColumn && columnIndex === 0 ? "sticky" : undefined,
@@ -12,11 +12,36 @@ import { WebIcon, WebIconButton } from "../desktop/icons";
12
12
  import { WebMenu } from "../desktop/menu";
13
13
  import { WebPopover } from "../desktop/popover";
14
14
  import { useHorizontalOverflow } from "./overflow-fade";
15
+ import { FADE_PX } from "./overflow-fade-px";
16
+ import { isLiveResizing, onLiveResizeEnd } from "../../../ui/live-resize";
15
17
  import { useTopSurfaceColor } from "./top-surface";
16
18
  import { hideDragShield, showDragShield } from "./drag-shield";
17
19
 
18
20
  type CssVars = CSSProperties & Record<`--${string}`, string>;
19
21
 
22
+ /**
23
+ * Scrolls a strip so `tab` shows. A title-bar strip also keeps it clear of
24
+ * the fades at its edges (overflow-fade.ts), which would fade the active tab's
25
+ * box and let the header's rule show through it; when the tab cannot clear
26
+ * both, its start shows. At either end the fade on that side goes, so the
27
+ * first and last tabs sit at the edge.
28
+ */
29
+ function revealTab(list: HTMLElement | null, tab: HTMLElement | null, clearOfFades: boolean): void {
30
+ if (!list || !tab) return;
31
+ if (!clearOfFades) {
32
+ tab.scrollIntoView({ block: "nearest", inline: "nearest" });
33
+ return;
34
+ }
35
+ const box = list.getBoundingClientRect();
36
+ const rect = tab.getBoundingClientRect();
37
+ // How far to scroll right: at least this for the tab's end to clear the
38
+ // end fade, at most that for its start to clear the start fade.
39
+ const atLeast = rect.right - (box.right - FADE_PX);
40
+ const atMost = rect.left - (box.left + FADE_PX);
41
+ const delta = atLeast > 0 ? Math.min(atLeast, atMost) : atMost < 0 ? atMost : 0;
42
+ if (delta !== 0) list.scrollLeft += delta;
43
+ }
44
+
20
45
  export function WebTabs({
21
46
  tabs,
22
47
  activeValue,
@@ -61,11 +86,34 @@ export function WebTabs({
61
86
  // Again once the overflow chevron appears: it narrows the strip, which would
62
87
  // otherwise push the last tab's label past the edge.
63
88
  useEffect(() => {
64
- activeTabRef.current?.scrollIntoView({
65
- block: "nearest",
66
- inline: "nearest",
89
+ revealTab(tabListRef.current, activeTabRef.current, header);
90
+ }, [activeValue, tabs, overflowing, header]);
91
+ // A title-bar strip again when it changes width (its pane resized, focus
92
+ // showing the header's buttons), so the active tab stays clear of the fades;
93
+ // after a live resize rather than on every frame of it.
94
+ useEffect(() => {
95
+ const list = tabListRef.current;
96
+ if (!header || !list || typeof ResizeObserver === "undefined") return;
97
+ let width = list.clientWidth;
98
+ let pending = false;
99
+ const reveal = () => revealTab(list, activeTabRef.current, true);
100
+ const observer = new ResizeObserver(() => {
101
+ if (list.clientWidth === width) return;
102
+ width = list.clientWidth;
103
+ if (isLiveResizing()) pending = true;
104
+ else reveal();
67
105
  });
68
- }, [activeValue, tabs, overflowing]);
106
+ const stopListening = onLiveResizeEnd(() => {
107
+ if (!pending) return;
108
+ pending = false;
109
+ reveal();
110
+ });
111
+ observer.observe(list);
112
+ return () => {
113
+ observer.disconnect();
114
+ stopListening();
115
+ };
116
+ }, [header]);
69
117
  useEffect(() => {
70
118
  if (!overflowing) setOverflowMenuOpen(false);
71
119
  }, [overflowing]);
@@ -78,9 +126,8 @@ export function WebTabs({
78
126
  onSelect(value);
79
127
  // Also when the chosen tab was already active, so the effect above does not run.
80
128
  requestAnimationFrame(() => {
81
- tabListRef.current
82
- ?.querySelector<HTMLElement>(`[data-tab-value="${CSS.escape(value)}"]`)
83
- ?.scrollIntoView({ block: "nearest", inline: "nearest" });
129
+ const list = tabListRef.current;
130
+ revealTab(list, list?.querySelector<HTMLElement>(`[data-tab-value="${CSS.escape(value)}"]`) ?? null, header);
84
131
  });
85
132
  };
86
133
  const startReorder = (sourceValue: string, event: ReactMouseEvent<HTMLButtonElement>) => {
@@ -220,7 +267,9 @@ export function WebTabs({
220
267
  "--tab-active-fg": header ? "var(--pane-tab-active-fg)" : palette.activeFg,
221
268
  flex: "0 0 auto",
222
269
  minWidth: 0,
223
- margin: 0,
270
+ // A title-bar tab's margins are its look (styles.css): the active one
271
+ // reaches past the header's rule.
272
+ margin: header ? undefined : 0,
224
273
  transform: `translateX(${dragTranslateX}px)${sourceDragging ? " scale(1.03)" : ""}`,
225
274
  zIndex: dragSourceValue === tab.value ? 2 : undefined,
226
275
  willChange: dragSourceValue ? "transform" : undefined,
@@ -319,8 +319,9 @@ button, [data-gloom-interactive="true"] { cursor: pointer; }
319
319
  [data-gloom-role="status-bar"] span {
320
320
  line-height: var(--cell-h);
321
321
  }
322
- /* The returning-user strip under the header: one row of shell chrome, ruled off from the layout. */
323
- [data-gloom-role="since-last-visit"] {
322
+ /* The returning-user strip and the new Pro payer's row under the header: one row of shell chrome each, ruled off from the layout. */
323
+ [data-gloom-role="since-last-visit"],
324
+ [data-gloom-role="pro-welcome"] {
324
325
  flex: none;
325
326
  align-items: center;
326
327
  border-bottom: 1px solid var(--gloom-hairline);
@@ -535,6 +536,9 @@ button, [data-gloom-interactive="true"] { cursor: pointer; }
535
536
  /* Header colour left above a box, and the box's line: the header rule's width. */
536
537
  --pane-tab-top-gap: 2px;
537
538
  --pane-tab-rule: 1px;
539
+ /* The strip hangs this far past the rule into the pane (pane/header.tsx says
540
+ why), and only the active tab reaches into it: the others end on the rule. */
541
+ padding-bottom: var(--pane-tab-overhang, 0px);
538
542
  }
539
543
  [data-gloom-role="tab-list"][data-gloom-variant="header"] > [data-gloom-role="tab-button"] {
540
544
  height: calc(100% - var(--pane-tab-top-gap));
@@ -553,6 +557,10 @@ button, [data-gloom-interactive="true"] { cursor: pointer; }
553
557
  }
554
558
  [data-gloom-role="tab-list"][data-gloom-variant="header"] > [data-gloom-role="tab-button"]::after { content: none; }
555
559
  [data-gloom-role="tab-list"][data-gloom-variant="header"] > [data-gloom-role="tab-button"][data-active="true"] {
560
+ /* Past the rule into the pane, with the label where it was. */
561
+ height: calc(100% - var(--pane-tab-top-gap) + var(--pane-tab-overhang, 0px));
562
+ margin-bottom: calc(-1 * var(--pane-tab-overhang, 0px));
563
+ padding-bottom: calc(var(--pane-tab-top-gap) + 2 * var(--pane-tab-rule) - var(--pane-tab-top-inset, 0px) + var(--pane-tab-overhang, 0px));
556
564
  background-color: var(--pane-tab-active-bg, var(--gloom-bg));
557
565
  border-color: var(--pane-tab-border, var(--gloom-hairline));
558
566
  }
@@ -1639,13 +1647,13 @@ html[data-gloom-screenshot="true"] [data-gloom-role="chart-watermark"] {
1639
1647
  /* ===== Chrome: title-bar tab overflow, query bar edges, quick-add band ===== */
1640
1648
 
1641
1649
  /* Title-bar tabs that do not fit: a chevron after the strip lists them all.
1642
- The strip hangs over the header's rules; the padding puts the chevron back
1643
- on the header's centre line. */
1650
+ The strip hangs over the header's rules and past the bottom one; the
1651
+ padding puts the chevron back on the header's centre line. */
1644
1652
  .gloom-tab-overflow {
1645
1653
  flex: none;
1646
1654
  display: flex;
1647
1655
  align-items: center;
1648
- padding: var(--pane-tab-top-inset, 0px) 0 1px 2px;
1656
+ padding: var(--pane-tab-top-inset, 0px) 0 calc(1px + var(--pane-tab-overhang, 0px)) 2px;
1649
1657
  }
1650
1658
 
1651
1659
  /* A search with nothing beside it takes the room filters would have used. */
@@ -67,6 +67,10 @@ export async function handleDesktopBackendRequest(
67
67
  return null;
68
68
  case "ticker.loadAll":
69
69
  return backend.requireServices().tickerRepository.loadAllTickers();
70
+ case "ticker.changesElsewhere":
71
+ return backend.requireServices().tickerRepository.changesElsewhere?.() ?? null;
72
+ case "ticker.takeDeletedElsewhere":
73
+ return backend.requireServices().tickerRepository.takeRowsDeletedElsewhere?.() ?? [];
70
74
  case "ticker.load":
71
75
  return backend.requireServices().tickerRepository.loadTicker(request.payload.symbol);
72
76
  case "ticker.save":
@@ -7,7 +7,7 @@ import {
7
7
  reconcileAppSessionSnapshot,
8
8
  type AppSessionSnapshot,
9
9
  } from "../../../../core/state/session-persistence";
10
- import { saveConfig } from "../../../../data/config/store";
10
+ import { saveConfig, watchExternalConfigChanges } from "../../../../data/config/store";
11
11
  import { pluginAutoUpdateEnabled } from "../../../../plugins/auto-update";
12
12
  import { startNodePluginAutoUpdates } from "../../../../plugins/auto-update-node";
13
13
  import { getPluginSeedProgress, subscribePluginSeed } from "../../../../plugins/seed-progress";
@@ -167,6 +167,7 @@ export class DesktopBackend {
167
167
  private pluginAutoUpdatesStarted = false;
168
168
  private commandLinksScheduled = false;
169
169
  private remoteControlServer: RemoteControlServer | null = null;
170
+ private stopWatchingConfig: (() => void) | null = null;
170
171
  private readonly pendingDeepLinks: string[] = [];
171
172
  private readonly contextMenuRequestRpcs = new Map<string, DesktopRpc>();
172
173
  /** Extra windows open once the main window has drawn, like popped-out panes. */
@@ -494,15 +495,33 @@ export class DesktopBackend {
494
495
  });
495
496
  this.workspace = createDesktopWorkspace(config, this.getSessionSnapshot(), this.windowController?.screenSetup.windows);
496
497
  this.reconcileWindows();
498
+ this.watchConfigWrittenElsewhere(config.dataDir);
497
499
  return { config, services };
498
500
  }
499
501
 
502
+ /**
503
+ * A `gloom` command run beside the app writes the same config.json (an
504
+ * alert, a setting, a watchlist): the change is taken in and shown in every
505
+ * window, so no save of the app's copy writes over it.
506
+ */
507
+ private watchConfigWrittenElsewhere(dataDir: string): void {
508
+ this.stopWatchingConfig?.();
509
+ this.stopWatchingConfig = watchExternalConfigChanges(dataDir, (change) => {
510
+ if (!this.config || !this.workspace) return;
511
+ const next = change.apply(this.config);
512
+ if (next === this.config) return;
513
+ this.commitDesktopSnapshotInBackground(this.workspace.replaceConfig(next, { layoutChanged: false }), { persistConfig: false });
514
+ });
515
+ }
516
+
500
517
  /** Compiles the view's plugins ahead of its first `plugins.listExternal`. */
501
518
  prefetchExternalPluginBundles(): void {
502
519
  prefetchExternalPluginBundles();
503
520
  }
504
521
 
505
522
  teardownServices(): void {
523
+ this.stopWatchingConfig?.();
524
+ this.stopWatchingConfig = null;
506
525
  this.stopRemoteControlServer();
507
526
  this.capabilityBridge.disposeAll();
508
527
  this.httpStreamBridge.disposeAll();
@@ -908,6 +927,8 @@ export class DesktopBackend {
908
927
  case "update.start":
909
928
  case "update.apply":
910
929
  case "ticker.loadAll":
930
+ case "ticker.changesElsewhere":
931
+ case "ticker.takeDeletedElsewhere":
911
932
  case "ticker.load":
912
933
  case "ticker.save":
913
934
  case "ticker.delete":
@@ -187,7 +187,12 @@ function fromPrivateSource<T>(source: string, compile: (path: string) => T): T {
187
187
  writeFileSync(path, source, { flag: "wx", mode: 0o600 });
188
188
  return compile(path);
189
189
  } finally {
190
- rmSync(folder, { recursive: true, force: true });
190
+ // Windows can still hold the file for a moment; a folder left behind must not cost the window its minimum size.
191
+ try {
192
+ rmSync(folder, { recursive: true, force: true });
193
+ } catch (error) {
194
+ logFailure("window", "Could not remove the minimum size helper's temporary folder")(error);
195
+ }
191
196
  }
192
197
  }
193
198
 
@@ -272,6 +272,10 @@ interface DesktopBackendRequestMap {
272
272
  /** Installs the staged update and relaunches. Sent only when the user presses Restart. */
273
273
  "update.apply": { request: null; response: null };
274
274
  "ticker.loadAll": { request: null; response: TickerRecord[] };
275
+ /** Changes when another program commits to the database (`TickerStore.changesElsewhere`). */
276
+ "ticker.changesElsewhere": { request: null; response: number | null };
277
+ /** The rows another program deleted that the backend held (`TickerRepository.takeRowsDeletedElsewhere`). */
278
+ "ticker.takeDeletedElsewhere": { request: null; response: string[] };
275
279
  "ticker.load": { request: { symbol: string }; response: TickerRecord | null };
276
280
  "ticker.save": { request: { ticker: TickerRecord }; response: null };
277
281
  "ticker.delete": { request: { symbol: string }; response: null };
@@ -1,8 +1,9 @@
1
1
  /** @jsxImportSource react */
2
2
  import { useCallback, useEffect, useRef, useState, type ReactNode } from "react";
3
3
  import { FloatingPaneWrapper } from "../../../components/layout/floating-pane";
4
- import { CaptureDatesDataContext } from "../../../components/layout/pane/capture-status";
4
+ import { CaptureDatesDataContext, PaneCaptureContext } from "../../../components/layout/pane/capture-status";
5
5
  import { PaneFooterProvider, datesPaneData, hasPaneFooterContent, type PaneFooterSegment } from "../../../components/layout/pane/footer";
6
+ import { noteLineParts } from "../../../components/layout/pane/footer/model";
6
7
  import { resolvePaneBodyFrame } from "../../../components/layout/pane/sizing";
7
8
 
8
9
  /** What a capture's status line dates (`CaptureStatusLine`): the pane's own data, the quotes on screen, or neither. */
@@ -35,19 +36,45 @@ function nextFrames(count: number): Promise<void> {
35
36
  });
36
37
  }
37
38
 
38
- /** Keeps the start and the end of a line that does not fit, `keep` characters in all. */
39
- function middleEllipsis(text: string, keep: number): string {
39
+ /** What a cut line's ends do not start or end on beside the ellipsis: a separator or a space. */
40
+ const LOOSE_END = /^[\s·,;:]+|[\s·,;:]+$/gu;
41
+
42
+ /**
43
+ * Keeps the start and the end of a line that does not fit, `keep` characters
44
+ * in all, in whole words ("US trading day Mon … 15 min delayed"), never a
45
+ * word cut ("Mon 1…ose"); by characters only where not a word fits either end.
46
+ */
47
+ export function middleEllipsis(text: string, keep: number): string {
40
48
  if (keep >= text.length) return text;
41
- const head = Math.ceil(keep / 2);
42
- const tail = Math.max(0, keep - head);
43
- return `${text.slice(0, head).trimEnd()}…${tail > 0 ? text.slice(text.length - tail).trimStart() : ""}`;
49
+ const headRoom = Math.ceil(keep / 2);
50
+ const tailRoom = Math.max(0, keep - headRoom);
51
+ const words = text.split(" ");
52
+ let head = "";
53
+ for (const word of words) {
54
+ const next = head ? `${head} ${word}` : word;
55
+ if (next.length > headRoom) break;
56
+ head = next;
57
+ }
58
+ let tail = "";
59
+ for (const word of [...words].reverse()) {
60
+ const next = tail ? `${word} ${tail}` : word;
61
+ if (next.length > tailRoom) break;
62
+ tail = next;
63
+ }
64
+ head = head.replace(LOOSE_END, "");
65
+ tail = tail.replace(LOOSE_END, "");
66
+ if (head && tail) return `${head} … ${tail}`;
67
+ if (head) return `${head}…`;
68
+ return `${text.slice(0, headRoom).trimEnd()}…${tailRoom > 0 ? text.slice(text.length - tailRoom).trimStart() : ""}`;
44
69
  }
45
70
 
46
71
  /**
47
72
  * The first variant that fits; else, when the footer can make room (the
48
73
  * pane's own `as of` gives way), the first that fits then; else the last one
49
- * cut in the middle as little as it must be. `show` puts a text on screen and
50
- * resolves once it is drawn.
74
+ * cut in the middle, between words, as little as it must be. A note line
75
+ * keeps its share of the row (fitPaneFooterInfo): its first words say more
76
+ * than the rest of a status line. `show` puts a text on screen and resolves
77
+ * once it is drawn.
51
78
  */
52
79
  async function fitStatusLine(
53
80
  variants: readonly string[],
@@ -133,7 +160,8 @@ function useShotStatusLine(enabled: boolean, hasAsOf: () => boolean): ShotStatus
133
160
  }
134
161
 
135
162
  /**
136
- * Static captures retain warnings, what a filter leaves out (`capture`) and
163
+ * Static captures retain warnings, as one note line (the first note, cut
164
+ * after a whole word, and how many more there are), what a filter leaves out (`capture`) and
137
165
  * optional source status without action shortcuts. With `statusLine` the footer also carries the capture's dated
138
166
  * status line (`Fri 9 Oct close · 15 min delayed · markets closed · regular session opens Mon 13:30 UTC, 09:30 ET`),
139
167
  * inside the requested size: the body gives up the footer row for it. The
@@ -157,9 +185,17 @@ export function PaneShotFrame({ paneId, title, width, height, preserveStatus = f
157
185
  const datesData = statusLine && dates === "data";
158
186
  return <PaneFooterProvider>{(registeredFooter) => {
159
187
  const status: PaneFooterSegment[] = statusLine && statusText !== null ? [{ id: "shot-status", parts: [{ text: statusText, tone: "label" }] }] : [];
160
- const info = registeredFooter.info.filter((segment) => (preserveStatus || segment.icon === "warning" || segment.capture)
188
+ // A warning whose pane gives a picture no notes to print (`captureNotes` empty) leaves no segment.
189
+ const info = registeredFooter.info.filter((segment) => !(segment.icon === "warning" && segment.notes?.length === 0)
190
+ && (preserveStatus || segment.icon === "warning" || segment.capture)
161
191
  && !(datesPaneData(segment) && (datesData || crowded))
162
- && !(segment.quoteStatus && statusLine && dates !== null));
192
+ && !(segment.quoteStatus && statusLine && dates !== null))
193
+ // Nothing opens a picture's ⚠: its notes are the footer's one note line (noteLineParts).
194
+ .map((segment): PaneFooterSegment => {
195
+ if (segment.icon !== "warning") return segment;
196
+ const notes = segment.notes?.length ? segment.notes : [segment.label ?? segment.title ?? segment.parts.map((part) => part.text).join(" ")];
197
+ return { ...segment, icon: undefined, onPress: undefined, notes, parts: noteLineParts(notes, Number.POSITIVE_INFINITY) };
198
+ });
163
199
  shownAsOf.current = info.some(datesPaneData);
164
200
  const footer = { info: [...info, ...status], hints: [], menu: [], keys: [] };
165
201
  const bodyFrame = resolvePaneBodyFrame({
@@ -181,7 +217,9 @@ export function PaneShotFrame({ paneId, title, width, height, preserveStatus = f
181
217
  showActions={false}
182
218
  footer={footer}
183
219
  >
184
- <CaptureDatesDataContext.Provider value={datesData}>{children(bodyFrame)}</CaptureDatesDataContext.Provider>
220
+ <PaneCaptureContext.Provider value>
221
+ <CaptureDatesDataContext.Provider value={datesData}>{children(bodyFrame)}</CaptureDatesDataContext.Provider>
222
+ </PaneCaptureContext.Provider>
185
223
  </FloatingPaneWrapper>;
186
224
  }}</PaneFooterProvider>;
187
225
  }
@@ -1,4 +1,5 @@
1
1
  import { setCloudApiFetchTransport } from "../../../api-client";
2
+ import { marketReadLimitMs } from "../../../api-client/request";
2
3
  import {
3
4
  createProxyResponse,
4
5
  createProxyResponseHeaders,
@@ -11,7 +12,7 @@ import { setHttpFetchTransport } from "../../../utils/http-transport";
11
12
  import { backendRequest, onBackendMessage } from "./backend-rpc";
12
13
  import { logFailure } from "../../../utils/log-failure";
13
14
 
14
- const CLOUD_MARKET_HTTP_TIMEOUT_MS = 10_000;
15
+ const MARKET_FETCH_GRACE_MS = 1_000;
15
16
  /**
16
17
  * The view gives up on a feedback upload after 45 s (api-client/feedback.ts),
17
18
  * but aborting in the view does not stop the Bun process's fetch. Stop it a
@@ -59,7 +60,7 @@ async function electrobunCloudApiFetch(url: string, init?: RequestInit): Promise
59
60
  }
60
61
  const path = new URL(url).pathname;
61
62
  const timeoutMs = path.startsWith("/market/")
62
- ? CLOUD_MARKET_HTTP_TIMEOUT_MS
63
+ ? marketReadLimitMs(path) + MARKET_FETCH_GRACE_MS
63
64
  : path === "/telemetry/attention"
64
65
  ? 5_000
65
66
  : path.endsWith("/feedback") && init?.method === "POST"
@@ -7,6 +7,16 @@ export class RemoteTickerRepository {
7
7
  return backendRequest("ticker.loadAll");
8
8
  }
9
9
 
10
+ /** Changes when another program (a `gloom` command, the terminal app) commits to the profile's database. */
11
+ changesElsewhere(): Promise<number | null> {
12
+ return backendRequest("ticker.changesElsewhere");
13
+ }
14
+
15
+ /** The rows another program deleted that the backend held, for this window to drop from what it shows. */
16
+ takeRowsDeletedElsewhere(): Promise<string[]> {
17
+ return backendRequest("ticker.takeDeletedElsewhere");
18
+ }
19
+
10
20
  async loadTicker(symbol: string): Promise<TickerRecord | null> {
11
21
  return backendRequest("ticker.load", { symbol });
12
22
  }