gloomberb 0.19.4 → 0.19.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/package.json +3 -1
  2. package/patches/@opentui%2Fcore@0.3.2.patch +86 -25
  3. package/src/api-client/equity-screener.ts +23 -0
  4. package/src/app/pane-runtime/index.tsx +2 -0
  5. package/src/app/pane-runtime/plugin-bindings.ts +10 -1
  6. package/src/app.tsx +63 -16
  7. package/src/cli/commands/command-utils.ts +4 -0
  8. package/src/cli/commands/market.ts +264 -33
  9. package/src/cli/commands/search.ts +22 -4
  10. package/src/cli/commands/ticker.ts +84 -39
  11. package/src/cli/currency-name-hint.ts +60 -0
  12. package/src/cli/glossary.ts +3 -3
  13. package/src/cli/history-rows.ts +18 -1
  14. package/src/cli/known-gaps.ts +25 -2
  15. package/src/cli/listing-arg.ts +12 -0
  16. package/src/cli/not-a-ticker.ts +5 -3
  17. package/src/cli/pane-functions/capabilities.ts +2 -0
  18. package/src/cli/pane-functions/catalog.ts +31 -5
  19. package/src/cli/pane-functions/function-help.ts +8 -5
  20. package/src/cli/pane-functions/headless.ts +11 -6
  21. package/src/cli/pane-functions/market-session.ts +6 -7
  22. package/src/cli/pane-functions/resolver.ts +75 -2
  23. package/src/cli/quote-answer.ts +9 -0
  24. package/src/cli/series-search.ts +4 -5
  25. package/src/cli/symbol-list.ts +54 -2
  26. package/src/cli/symbol-rows.ts +14 -2
  27. package/src/cli/ticker-resolution.ts +89 -20
  28. package/src/components/chart/composite/axis-overlays.tsx +60 -27
  29. package/src/components/chart/composite/composite-chart.tsx +118 -63
  30. package/src/components/chart/composite/cursor-source.ts +111 -0
  31. package/src/components/chart/composite/format.ts +168 -6
  32. package/src/components/chart/composite/legend.tsx +8 -4
  33. package/src/components/chart/composite/panel-bitmap.ts +28 -2
  34. package/src/components/chart/composite/panel-labels.ts +20 -1
  35. package/src/components/chart/composite/panel-surface.tsx +201 -92
  36. package/src/components/chart/composite/price-axis-labels.tsx +92 -46
  37. package/src/components/chart/composite/price-series.ts +31 -8
  38. package/src/components/chart/composite/scene.ts +154 -59
  39. package/src/components/chart/composite/series-axis-tags.tsx +4 -2
  40. package/src/components/chart/composite/time-axis.ts +30 -7
  41. package/src/components/chart/composite/time-scale.ts +211 -56
  42. package/src/components/chart/composite/types.ts +11 -1
  43. package/src/components/chart/composite/use-composite-chart-keyboard.ts +32 -12
  44. package/src/components/chart/curve/curve-surface.tsx +5 -2
  45. package/src/components/chart/curve/model.ts +4 -1
  46. package/src/components/chart/native/use-bitmap-metrics.ts +81 -0
  47. package/src/components/chart/static/series.ts +3 -0
  48. package/src/components/command-bar/commands/collection-list.ts +81 -0
  49. package/src/components/command-bar/commands/direct/index.ts +6 -0
  50. package/src/components/command-bar/commands/registry.ts +8 -0
  51. package/src/components/command-bar/layout-items/current-layout.ts +22 -1
  52. package/src/components/command-bar/layout-items/focused-pane.ts +22 -1
  53. package/src/components/command-bar/pane-templates/items.ts +19 -3
  54. package/src/components/command-bar/pane-templates/workflow.ts +5 -0
  55. package/src/components/command-bar/routes/root/results.ts +23 -3
  56. package/src/components/command-bar/routes/root/selection.ts +4 -2
  57. package/src/components/command-bar/routes/root/shortcut-feedback.ts +1 -1
  58. package/src/components/command-bar/routes/root/shortcut-items.ts +3 -4
  59. package/src/components/command-bar/routes/root/shortcuts.ts +58 -14
  60. package/src/components/command-bar/routes/root/ticker-first.ts +32 -0
  61. package/src/components/command-bar/surface/environment.ts +2 -0
  62. package/src/components/command-bar/view-model.ts +7 -0
  63. package/src/components/command-bar/workflow/ops.ts +2 -1
  64. package/src/components/command-bar/workflow/tickers.ts +20 -0
  65. package/src/components/layout/shell/active-drag.ts +38 -7
  66. package/src/components/layout/shell/drag/magnets.ts +106 -0
  67. package/src/components/layout/shell/menu.ts +15 -1
  68. package/src/components/layout/shell/pane/actions.ts +4 -0
  69. package/src/components/layout/shell/ticker-link-menu.ts +12 -3
  70. package/src/components/layout/status-bar.tsx +20 -0
  71. package/src/components/layout/window-controls.tsx +96 -35
  72. package/src/components/layout/window-fullscreen.ts +20 -0
  73. package/src/components/onboarding/onboarding-keyboard.ts +5 -1
  74. package/src/components/onboarding/onboarding-wizard.tsx +15 -4
  75. package/src/components/onboarding/portfolio-step/positions-panel.tsx +8 -5
  76. package/src/components/onboarding/use-onboarding-progress.ts +20 -1
  77. package/src/components/price-sparkline/view.tsx +14 -6
  78. package/src/components/quote-flash.ts +36 -32
  79. package/src/components/ticker/badge/index.tsx +8 -4
  80. package/src/components/ticker/badge/list.tsx +23 -7
  81. package/src/components/ui/column-grid.tsx +8 -2
  82. package/src/components/ui/data-table/opentui/model.ts +4 -1
  83. package/src/components/ui/tabs.tsx +5 -2
  84. package/src/core/state/app/layout.ts +18 -3
  85. package/src/core/state/app/state.ts +2 -0
  86. package/src/core/state/app/types.ts +5 -0
  87. package/src/data/config/layout.ts +3 -0
  88. package/src/data/config/store/normalize.ts +39 -4
  89. package/src/i18n/es.ts +10 -0
  90. package/src/i18n/ja.ts +10 -0
  91. package/src/i18n/ko.ts +10 -0
  92. package/src/i18n/zh-cn.ts +10 -0
  93. package/src/i18n/zh-tw.ts +10 -0
  94. package/src/layout/pane-manager/floating-placement.ts +7 -4
  95. package/src/layout/pane-manager/floating.ts +5 -2
  96. package/src/market-data/bond-funds.ts +19 -0
  97. package/src/market-data/coordinator/events.ts +17 -1
  98. package/src/market-data/frame-scheduler.ts +47 -10
  99. package/src/market-data/frame-wake.ts +74 -0
  100. package/src/market-data/futures-board.ts +7 -6
  101. package/src/market-data/futures-contract.ts +14 -3
  102. package/src/market-data/hooks.tsx +12 -3
  103. package/src/market-data/market/freshness.ts +18 -0
  104. package/src/market-data/market/status.ts +15 -2
  105. package/src/market-data/performance.ts +78 -9
  106. package/src/market-data/request-types.ts +6 -3
  107. package/src/plugins/builtin/alerts/cli.ts +2 -1
  108. package/src/plugins/builtin/analytics/risk-evidence.ts +1 -0
  109. package/src/plugins/builtin/attention/evidence.ts +1 -1
  110. package/src/plugins/builtin/awards/client.ts +1 -1
  111. package/src/plugins/builtin/awards/evidence.ts +1 -1
  112. package/src/plugins/builtin/awards/pane.tsx +2 -1
  113. package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
  114. package/src/plugins/builtin/bond-calculator/index.tsx +1 -1
  115. package/src/plugins/builtin/bond-calculator/math.ts +1 -1
  116. package/src/plugins/builtin/bond-calculator/model.ts +14 -5
  117. package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
  118. package/src/plugins/builtin/broker-manager/footer.ts +3 -2
  119. package/src/plugins/builtin/broker-manager/index.tsx +2 -1
  120. package/src/plugins/builtin/broker-manager/keyboard.ts +2 -1
  121. package/src/plugins/builtin/buildout/cells.tsx +25 -45
  122. package/src/plugins/builtin/buildout/detail/company.tsx +3 -3
  123. package/src/plugins/builtin/buildout/detail/index.tsx +1 -1
  124. package/src/plugins/builtin/buildout/detail/intel.tsx +4 -7
  125. package/src/plugins/builtin/buildout/detail/site.tsx +4 -4
  126. package/src/plugins/builtin/buildout/detail/ui.tsx +39 -38
  127. package/src/plugins/builtin/buildout/format.ts +23 -1
  128. package/src/plugins/builtin/buildout/model/types.ts +1 -0
  129. package/src/plugins/builtin/buildout/pane/index.tsx +2 -8
  130. package/src/plugins/builtin/buildout/table-model.ts +12 -4
  131. package/src/plugins/builtin/catalysts/evidence.ts +1 -1
  132. package/src/plugins/builtin/catalysts/pane.tsx +2 -1
  133. package/src/plugins/builtin/cds/headless.ts +1 -0
  134. package/src/plugins/builtin/cds/index.tsx +1 -1
  135. package/src/plugins/builtin/chart-composer/headless.ts +40 -1
  136. package/src/plugins/builtin/cloud/plugin.tsx +2 -0
  137. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +28 -3
  138. package/src/plugins/builtin/cloud-tweets/table.tsx +3 -2
  139. package/src/plugins/builtin/comment-letters/client.ts +2 -1
  140. package/src/plugins/builtin/company-kpis/client.ts +1 -1
  141. package/src/plugins/builtin/company-kpis/pane.tsx +2 -1
  142. package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +3 -2
  143. package/src/plugins/builtin/correlation/headless.ts +3 -2
  144. package/src/plugins/builtin/cot/headless.ts +9 -3
  145. package/src/plugins/builtin/cot/model.ts +44 -3
  146. package/src/plugins/builtin/credit-documents/client.ts +1 -1
  147. package/src/plugins/builtin/credit-documents/evidence.ts +1 -1
  148. package/src/plugins/builtin/credit-documents/pane.tsx +2 -1
  149. package/src/plugins/builtin/crypto-board/pane.tsx +5 -4
  150. package/src/plugins/builtin/debt-maturities/headless.ts +11 -2
  151. package/src/plugins/builtin/debt-maturities/model.ts +66 -0
  152. package/src/plugins/builtin/debt-maturities/pane.tsx +23 -4
  153. package/src/plugins/builtin/earnings-calls/pane.tsx +1 -1
  154. package/src/plugins/builtin/earnings-ripple/index.tsx +6 -1
  155. package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
  156. package/src/plugins/builtin/econ/calendar-model.ts +30 -6
  157. package/src/plugins/builtin/econ/fred-catalog.ts +5 -5
  158. package/src/plugins/builtin/econ/print-watch.ts +3 -1
  159. package/src/plugins/builtin/equity-screener/client.ts +1 -1
  160. package/src/plugins/builtin/equity-screener/criterion-editor.tsx +4 -16
  161. package/src/plugins/builtin/equity-screener/headless.ts +4 -2
  162. package/src/plugins/builtin/equity-screener/ideas.ts +67 -3
  163. package/src/plugins/builtin/equity-screener/model.ts +180 -12
  164. package/src/plugins/builtin/equity-screener/pane.tsx +52 -12
  165. package/src/plugins/builtin/equity-screener/screen-check.ts +7 -4
  166. package/src/plugins/builtin/equity-screener/watchlist.ts +33 -0
  167. package/src/plugins/builtin/futures/series.ts +16 -1
  168. package/src/plugins/builtin/futures-curve/client.ts +19 -0
  169. package/src/plugins/builtin/futures-curve/headless.ts +52 -13
  170. package/src/plugins/builtin/futures-curve/index.tsx +1 -1
  171. package/src/plugins/builtin/futures-curve/model.ts +77 -6
  172. package/src/plugins/builtin/futures-curve/pane.tsx +19 -3
  173. package/src/plugins/builtin/fx-matrix/headless.ts +4 -2
  174. package/src/plugins/builtin/fx-matrix/index.tsx +37 -3
  175. package/src/plugins/builtin/fx-matrix/pairs.ts +15 -0
  176. package/src/plugins/builtin/gpu/headless.ts +2 -1
  177. package/src/plugins/builtin/help/function-card.tsx +2 -1
  178. package/src/plugins/builtin/help/index.tsx +2 -1
  179. package/src/plugins/builtin/insider/display.ts +45 -6
  180. package/src/plugins/builtin/ipo-calendar/model.ts +2 -0
  181. package/src/plugins/builtin/iv-history/client.ts +2 -1
  182. package/src/plugins/builtin/iv-history/headless.ts +2 -1
  183. package/src/plugins/builtin/jobs/pages.ts +4 -4
  184. package/src/plugins/builtin/kelly-sizer/headless.ts +2 -1
  185. package/src/plugins/builtin/macro-day/client.ts +41 -0
  186. package/src/plugins/builtin/macro-day/headless.ts +19 -9
  187. package/src/plugins/builtin/macro-day/model.ts +3 -1
  188. package/src/plugins/builtin/market-heatmap/index.tsx +2 -1
  189. package/src/plugins/builtin/market-movers/index.tsx +4 -3
  190. package/src/plugins/builtin/members/client.ts +1 -1
  191. package/src/plugins/builtin/mna/distress/client.ts +1 -0
  192. package/src/plugins/builtin/mna/distress/headless.ts +1 -0
  193. package/src/plugins/builtin/mna/pane.tsx +4 -1
  194. package/src/plugins/builtin/options/market-reference.ts +1 -1
  195. package/src/plugins/builtin/options/open-interest-as-of.ts +3 -1
  196. package/src/plugins/builtin/options/view.tsx +2 -1
  197. package/src/plugins/builtin/options-calculator/evidence.ts +1 -1
  198. package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
  199. package/src/plugins/builtin/options-scenario/csp-screen.ts +8 -4
  200. package/src/plugins/builtin/options-scenario/csp.ts +28 -9
  201. package/src/plugins/builtin/options-scenario/evidence.ts +5 -4
  202. package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
  203. package/src/plugins/builtin/perps/client.ts +1 -1
  204. package/src/plugins/builtin/perps/pane.tsx +3 -1
  205. package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +17 -0
  206. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +2 -1
  207. package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +4 -2
  208. package/src/plugins/builtin/portfolio-list/pane/index.tsx +7 -3
  209. package/src/plugins/builtin/portfolio-list/use-throttled-memo.ts +10 -19
  210. package/src/plugins/builtin/rate-path/headless.ts +24 -10
  211. package/src/plugins/builtin/research/analyst-model.ts +1 -0
  212. package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +2 -1
  213. package/src/plugins/builtin/research/event-model.ts +10 -3
  214. package/src/plugins/builtin/research/events-headless.ts +20 -2
  215. package/src/plugins/builtin/research/index.tsx +1 -0
  216. package/src/plugins/builtin/research/relative-valuation-currency.ts +1 -1
  217. package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -1
  218. package/src/plugins/builtin/research-search/command-bar-search.ts +3 -1
  219. package/src/plugins/builtin/research-search/snippet.ts +1 -0
  220. package/src/plugins/builtin/revenue-breakdown/client.ts +3 -2
  221. package/src/plugins/builtin/seasonality/headless.ts +2 -1
  222. package/src/plugins/builtin/sec/command-bar-search.ts +3 -2
  223. package/src/plugins/builtin/sec/fund-facts.ts +17 -1
  224. package/src/plugins/builtin/sec/index.tsx +8 -5
  225. package/src/plugins/builtin/sec/row-summaries.ts +28 -12
  226. package/src/plugins/builtin/shared/members-menu.tsx +103 -38
  227. package/src/plugins/builtin/short-interest/publications-model.ts +22 -1
  228. package/src/plugins/builtin/short-interest/publications-pane.tsx +13 -4
  229. package/src/plugins/builtin/short-interest/watch-client.ts +2 -1
  230. package/src/plugins/builtin/short-interest/watch-model.ts +1 -1
  231. package/src/plugins/builtin/social-mentions/client.ts +2 -1
  232. package/src/plugins/builtin/supply-chain/client.ts +1 -1
  233. package/src/plugins/builtin/supply-chain/evidence.ts +1 -1
  234. package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -1
  235. package/src/plugins/builtin/supply-chain/pane.tsx +2 -1
  236. package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +1 -1
  237. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +24 -4
  238. package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +1 -1
  239. package/src/plugins/builtin/time-sales/client.ts +1 -0
  240. package/src/plugins/builtin/time-sales/pane.tsx +3 -2
  241. package/src/plugins/builtin/trace-bonds/client.ts +7 -4
  242. package/src/plugins/builtin/trace-bonds/index.tsx +1 -1
  243. package/src/plugins/builtin/vol-surface/client.ts +2 -1
  244. package/src/plugins/builtin/volatility/client.ts +6 -1
  245. package/src/plugins/builtin/volatility/headless.ts +0 -1
  246. package/src/plugins/builtin/yield-curve/curves.ts +15 -0
  247. package/src/plugins/builtin/yield-curve/headless.ts +9 -2
  248. package/src/plugins/builtin/yield-curve/index.tsx +5 -8
  249. package/src/plugins/host-modules.ts +22 -3
  250. package/src/plugins/host-smoke.ts +6 -3
  251. package/src/portfolio/collection-name.ts +19 -0
  252. package/src/portfolio/column-values.ts +76 -10
  253. package/src/renderers/browser/http-proxy-transport.ts +78 -8
  254. package/src/renderers/cloudflare/http-proxy.ts +13 -2
  255. package/src/renderers/cloudflare/proxy-session.ts +47 -24
  256. package/src/renderers/cloudflare/worker.ts +15 -2
  257. package/src/renderers/desktop/geometry.ts +279 -0
  258. package/src/renderers/desktop/screen-setup.ts +246 -0
  259. package/src/renderers/desktop/sequential-window-host.ts +179 -0
  260. package/src/renderers/desktop/test-utils.ts +71 -0
  261. package/src/renderers/desktop/window-controller.ts +433 -0
  262. package/src/renderers/desktop/window-host.ts +70 -0
  263. package/src/renderers/desktop/window-layouts.ts +630 -0
  264. package/src/renderers/dom/data-frames.ts +15 -4
  265. package/src/renderers/dom/host/box.tsx +204 -176
  266. package/src/renderers/dom/host/style.ts +49 -20
  267. package/src/renderers/dom/host/text.tsx +3 -2
  268. package/src/renderers/electrobun/bun/application-menu/click.ts +1 -0
  269. package/src/renderers/electrobun/bun/application-menu/index.ts +4 -1
  270. package/src/renderers/electrobun/bun/desktop/backend-requests.ts +19 -8
  271. package/src/renderers/electrobun/bun/desktop/backend.ts +322 -19
  272. package/src/renderers/electrobun/bun/desktop/detached-windows.ts +83 -61
  273. package/src/renderers/electrobun/bun/desktop/host-requests.ts +29 -15
  274. package/src/renderers/electrobun/bun/desktop/initialization.ts +30 -11
  275. package/src/renderers/electrobun/bun/desktop/relaunch.ts +9 -1
  276. package/src/renderers/electrobun/bun/desktop/screen-setup-file.ts +55 -0
  277. package/src/renderers/electrobun/bun/desktop/state-broadcaster.ts +44 -8
  278. package/src/renderers/electrobun/bun/desktop/windows-script.ts +9 -6
  279. package/src/renderers/electrobun/bun/desktop/workspace/index.ts +298 -97
  280. package/src/renderers/electrobun/bun/desktop/workspace/requests.ts +44 -6
  281. package/src/renderers/electrobun/bun/index.ts +4 -97
  282. package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +306 -0
  283. package/src/renderers/electrobun/bun/window/focus.ts +0 -25
  284. package/src/renderers/electrobun/bun/window/remembered-frame.ts +4 -82
  285. package/src/renderers/electrobun/bun/window/windows-native.ts +26 -1
  286. package/src/renderers/electrobun/shared/protocol.ts +50 -2
  287. package/src/renderers/electrobun/view/backend-rpc.ts +15 -0
  288. package/src/renderers/electrobun/view/desktop/window/bridge.ts +63 -3
  289. package/src/renderers/electrobun/view/main.tsx +13 -7
  290. package/src/renderers/electrobun/view/ui-host.tsx +7 -0
  291. package/src/renderers/electrobun/view/window-fullscreen.ts +10 -3
  292. package/src/series/fred-argument.ts +17 -0
  293. package/src/sources/provider-router/financial-routes.ts +7 -1
  294. package/src/sources/provider-router/index.ts +7 -1
  295. package/src/state/app/context/index.tsx +16 -2
  296. package/src/state/desktop-windows.ts +63 -0
  297. package/src/sync/other-window-tabs.ts +62 -0
  298. package/src/tickers/company-name-listing.ts +23 -3
  299. package/src/tickers/listing-fate.ts +147 -1
  300. package/src/tickers/terminal-codes.ts +5 -0
  301. package/src/time-series/price-units.ts +11 -0
  302. package/src/time-series/types.ts +6 -0
  303. package/src/types/config.ts +10 -1
  304. package/src/types/desktop-window.ts +71 -2
  305. package/src/types/financials.ts +4 -0
  306. package/src/types/headless.ts +19 -0
  307. package/src/types/plugin.ts +6 -0
  308. package/src/ui/host.tsx +2 -0
  309. package/src/ui/index.tsx +14 -13
  310. package/src/ui/same-props.ts +58 -0
  311. package/src/utils/cli-output.ts +33 -4
  312. package/src/utils/currency-names.ts +20 -0
  313. package/src/utils/currency-pair.ts +6 -0
  314. package/src/utils/exchange-rate-snapshot.ts +20 -2
  315. package/src/utils/format.ts +7 -2
  316. package/src/utils/futures-generic.ts +12 -0
  317. package/src/utils/fx-market-hours.ts +43 -0
  318. package/src/utils/http-proxy-upstream.ts +6 -2
  319. package/src/utils/plugin-proxy-hosts.json +0 -4
  320. package/src/utils/plugin-proxy-hosts.ts +22 -0
  321. package/src/utils/sec-filings.ts +7 -1
@@ -46,10 +46,11 @@ function brokerContractForTicker(
46
46
  const contracts = ticker?.metadata.broker_contracts ?? [];
47
47
  const portfolioId = options.portfolioId;
48
48
  if (portfolioId) {
49
- const positions = ticker?.metadata.positions.filter((position) => position.portfolio === portfolioId && position.shares !== 0) ?? [];
50
- const selected = new Map<string, BrokerContractRef>();
49
+ // Rows ask on every render of a list: nothing is allocated for a portfolio's lots until one names a contract.
50
+ let selected: Map<string, BrokerContractRef> | null = null;
51
51
  let hasPublicPosition = false;
52
- for (const position of positions) {
52
+ for (const position of ticker?.metadata.positions ?? []) {
53
+ if (position.portfolio !== portfolioId || position.shares === 0) continue;
53
54
  const hasExplicitId = position.brokerContractId != null;
54
55
  const hasExplicitIdentity = position.brokerContractIdentity != null;
55
56
  const hasLegacyScope = position.broker !== "manual" && !!position.broker && !!position.brokerInstanceId;
@@ -68,11 +69,13 @@ function brokerContractForTicker(
68
69
  hasPublicPosition = true;
69
70
  continue;
70
71
  }
72
+ selected ??= new Map();
71
73
  for (const contract of matches) {
72
74
  const key = scopedBrokerContractIdentityKey(contract);
73
75
  selected.set(key, contract);
74
76
  }
75
77
  }
78
+ if (!selected) return null;
76
79
  // One ticker quote must identify every selected lot. Never choose by array order.
77
80
  if (selected.size > 1 || (selected.size > 0 && hasPublicPosition)) return undefined;
78
81
  return selected.values().next().value ?? null;
@@ -1110,7 +1110,8 @@ export const alertsCliCommand: CliCommandDef = {
1110
1110
  });
1111
1111
  return;
1112
1112
  }
1113
- if (action === "delete" || action === "rm") {
1113
+ // `remove`, as the command's own description says it does, and `rm` delete as `delete` does.
1114
+ if (action === "delete" || action === "remove" || action === "rm") {
1114
1115
  const id = requireArg(args[1], "Usage: gloom alerts delete <id>", ctx);
1115
1116
  const level = alerts.find((alert) => alert.id === id) ?? null;
1116
1117
  const rule = level ? null : events.rules.find((entry) => entry.id === id) ?? null;
@@ -480,6 +480,7 @@ export function brokerPerformanceEvidence(
480
480
  performance: { flowTiming: "end-of-day", externalFlowsComplete: true, observations },
481
481
  }), now);
482
482
  } catch {
483
+ // Intentional ignore: account history that fails evidence validation does not qualify as evidence.
483
484
  return null;
484
485
  }
485
486
  }
@@ -19,7 +19,7 @@ export const attentionScreenshotEvidence: PaneScreenshotEvidenceHook<AttentionEv
19
19
  if (!isRecord(value) || value.kind !== "attention" || value.version !== 1 || value.complete !== true
20
20
  || !isRecord(value.payload) || attentionTab(value.tab) !== value.tab || typeof value.selectedSymbol !== "string"
21
21
  || !Number.isInteger(value.plottedValueCount) || Number(value.plottedValueCount) < 0) return null;
22
- try { validateAttention(value.payload as unknown as AttentionPayload); return value as unknown as AttentionEvidence; } catch { return null; }
22
+ try { validateAttention(value.payload as unknown as AttentionPayload); return value as unknown as AttentionEvidence; } catch { /* Intentional ignore: invalid captured observations are rejected as evidence by returning null. */ return null; }
23
23
  },
24
24
  mismatches(evidence, { resolved }) {
25
25
  return [evidence.payload.window !== attentionWindow(resolved.options.window) ? "Attention window does not match" : null,
@@ -14,7 +14,7 @@ const optionalText = (value: unknown) => value == null || text(value);
14
14
  const amount = (value: unknown) => value == null || text(value) && /^-?\d+(?:\.\d+)?$/.test(value) && Number.isFinite(Number(value));
15
15
  const date = (value: unknown) => text(value) && /^\d{4}-\d{2}-\d{2}$/.test(value) && Number.isFinite(Date.parse(value)) && new Date(value).toISOString().slice(0, 10) === value;
16
16
  const instant = (value: unknown) => text(value) && Number.isFinite(Date.parse(value));
17
- const url = (value: unknown) => { try { return text(value) && ["https:", "http:"].includes(new URL(value).protocol); } catch { return false; } };
17
+ const url = (value: unknown) => { try { return text(value) && ["https:", "http:"].includes(new URL(value).protocol); } catch { /* Intentional ignore: malformed URLs fail this web link field validator. */ return false; } };
18
18
  const confidence = (value: unknown) => typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 1;
19
19
  const count = (value: unknown) => Number.isSafeInteger(value) && Number(value) >= 0;
20
20
  const currency = (value: unknown) => text(value) && /^[A-Z]{3}$/.test(value);
@@ -24,7 +24,7 @@ export const awardsScreenshotEvidence: PaneScreenshotEvidenceHook<AwardsEvidence
24
24
  read(value) {
25
25
  if (!isRecord(value) || value.kind !== "government-awards" || value.version !== 1 || value.complete !== true || !Number.isSafeInteger(value.plottedValueCount)
26
26
  || Number(value.plottedValueCount) < 0 || awardTab(value.tab) !== value.tab || !isRecord(value.payload)) return null;
27
- try { validateAwards(value.payload as unknown as AwardsPayload); return value as unknown as AwardsEvidence; } catch { return null; }
27
+ try { validateAwards(value.payload as unknown as AwardsPayload); return value as unknown as AwardsEvidence; } catch { /* Intentional ignore: invalid captured observations are rejected as evidence by returning null. */ return null; }
28
28
  },
29
29
  mismatches(evidence, { resolved, payload }) {
30
30
  const snapshot = payload.config.layout.instances.find((entry) => entry.instanceId === payload.paneId)?.settings?.awardsSnapshot;
@@ -26,6 +26,7 @@ import { AWARDS_UNAVAILABLE, fetchAwards, loadAward, loadAwards, validateAwards
26
26
  import { useAwardsEvidence } from "./evidence";
27
27
  import { AWARD_TABS, aggregateId, awardHistorySeries, awardPercent, awardPeriod, awardScope, awardsCoverageNotes, awardsPreviewNote, awardTab, awardTypeLabel, futureAwardDatesNote, money,
28
28
  rankedAggregates } from "./model";
29
+ import { logFailure } from "../../../utils/log-failure";
29
30
 
30
31
  type Item = { kind: "award"; row: AwardRow } | { kind: "aggregate"; row: AwardAggregate } | { kind: "leader"; row: AwardCompanyLeader } | { kind: "locked"; id: string }
31
32
  | { kind: "section"; id: string; label: string; count: number } | { kind: "note"; id: string; text: string };
@@ -116,7 +117,7 @@ function AwardsView({ width, height, focused, symbol }: PaneProps & { symbol: st
116
117
  const [selectedId, setSelected] = usePluginPaneState<string | null>(`awards:selection:${tab}`, null);
117
118
  const search = useQueryBarSearch(), tickerSearch = useQueryBarSearch();
118
119
  const [snapshotSetting] = usePaneSettingValue<AwardsPayload | null>("awardsSnapshot", null);
119
- const snapshot = useMemo(() => { try { return snapshotSetting ? validateAwards(snapshotSetting) : null; } catch { return null; } }, [snapshotSetting]);
120
+ const snapshot = useMemo(() => { try { return snapshotSetting ? validateAwards(snapshotSetting) : null; } catch (error) { return logFailure("awards.pane", "Validate awards snapshot failed", null)(error); } }, [snapshotSetting]);
120
121
  const filter = useMemo<AwardFilter>(() => ({ ticker: ticker.trim().toUpperCase() || undefined, query: query.trim() || undefined,
121
122
  jurisdiction: jurisdiction || undefined, currency: currency || undefined, source: source || undefined, awardType, agency: agency || undefined, sector: sector || undefined, parentId: parentId || undefined,
122
123
  from: parentId ? undefined : range === "all" ? from || undefined : new Date(Date.now() - Number(range) * 86_400_000).toISOString().slice(0, 10), to: parentId ? undefined : to || undefined, limit: 100,
@@ -45,7 +45,8 @@ export const bondCalculatorHeadless: HeadlessPaneDefinition<"bundle"> = {
45
45
  { label: "Macaulay duration", value: a.macaulayDuration, formatted: `${a.macaulayDuration.toFixed(4)} years` },
46
46
  { label: "Modified duration", value: a.modifiedDuration, formatted: `${a.modifiedDuration.toFixed(4)} years` },
47
47
  { label: "Convexity", value: a.convexity, formatted: a.convexity.toFixed(4) },
48
- { label: "DV01", value: a.dv01, formatted: a.dv01.toFixed(6) },
48
+ // The price change for a 1bp fall in yield, per 100 face as the prices are: 0.045493 is $45.49 on $100,000.
49
+ { label: "DV01", value: a.dv01, formatted: `${a.dv01.toFixed(6)} per 100 face` },
49
50
  { label: "Treasury spread", value: result.spread?.spreadBps ?? null, formatted: result.spread ? `${result.spread.spreadBps.toFixed(1)} bp as of ${result.spread.asOf}` : "Unavailable" },
50
51
  ] },
51
52
  { title: "Cash flows per 100 face", columns: [{ key: "date", header: "Payment" }, { key: "amount", header: "Cash", format: (n) => Number(n).toFixed(4) }, { key: "presentValue", header: "Present value", format: (n) => Number(n).toFixed(4) }], rows: a.cashFlows.map((flow) => ({ ...flow })) },
@@ -5,6 +5,6 @@ import { fixedIncomeShortcut } from "../fixed-income/shortcut";
5
5
  export const bondCalculatorModule: PluginModule = {
6
6
  paneTemplates: [fixedIncomeShortcut({ id: "bond-calculator-pane", paneId: "bond-calculator", label: "Bond Calculator",
7
7
  description: "Price, yield, accrued interest, duration, convexity and Treasury spread for a fixed coupon bond.",
8
- keywords: ["yas", "bond", "calculator", "yield", "price", "duration", "dv01"], shortcut: { prefix: "YAS" },
8
+ keywords: ["yas", "bond", "calculator", "yield", "price", "duration", "dv01", "hedge ratio", "steepener", "flattener"], shortcut: { prefix: "YAS" },
9
9
  headless: bondCalculatorHeadless, createInstance: () => ({}) }, "bonds", "calculator")],
10
10
  };
@@ -157,7 +157,7 @@ export function treasurySpread(terms: BondTerms, yieldPercent: number, curve: re
157
157
  const before = points.findLast((point) => point.maturityYears <= maturityYears);
158
158
  const after = points.find((point) => point.maturityYears >= maturityYears);
159
159
  if (!before || !after || !before.asOf || before.asOf !== after.asOf) return null;
160
- try { parseDate(before.asOf); } catch { return null; }
160
+ try { parseDate(before.asOf); } catch { /* Intentional ignore: a benchmark curve with an unreadable date gives no spread. */ return null; }
161
161
  const weight = before === after ? 0 : (maturityYears - before.maturityYears) / (after.maturityYears - before.maturityYears);
162
162
  const benchmarkPercent = before.yieldPercent! + weight * (after.yieldPercent! - before.yieldPercent!);
163
163
  return { benchmarkPercent, spreadBps: (yieldPercent - benchmarkPercent) * 100, asOf: before.asOf, maturityYears };
@@ -20,18 +20,27 @@ export function defaultBondDraft(now = new Date()): BondDraft {
20
20
  frequency: "2", dayCount: "act-act-icma", endOfMonth: false };
21
21
  }
22
22
 
23
- function inputNumber(value: string, label: string): number {
24
- if (!value.trim() || !/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(value.trim())) throw new Error(numberErrorMessage(`${label} must be a number`, value));
25
- const number = Number(value);
23
+ /**
24
+ * A coupon or yield typed with a decimal comma (`3,875`, `-0,25`) reads as the
25
+ * decimal it is: a percent rate is never in the thousands, so `3,875` is
26
+ * 3.875%, not 3875. A clean price keeps the dot it is told to use.
27
+ */
28
+ const DECIMAL_COMMA_RATE = /^([+-]?\d+),(\d+)$/;
29
+
30
+ function inputNumber(value: string, label: string, decimalComma = false): number {
31
+ const comma = decimalComma ? DECIMAL_COMMA_RATE.exec(value.trim()) : null;
32
+ const text = comma ? `${comma[1]}.${comma[2]}` : value.trim();
33
+ if (!text || !/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(text)) throw new Error(numberErrorMessage(`${label} must be a number`, value));
34
+ const number = Number(text);
26
35
  if (!Number.isFinite(number)) throw new Error(`${label} must be finite`);
27
36
  return number;
28
37
  }
29
38
 
30
39
  export function calculateBond(draft: BondDraft, curve: readonly TreasuryBenchmarkPoint[] = []) {
31
40
  if (!["yield", "price"].includes(draft.mode)) throw new Error("Select price or yield input");
32
- const terms: BondTerms = { settlement: draft.settlement, maturity: draft.maturity, couponPercent: inputNumber(draft.coupon, "Coupon"),
41
+ const terms: BondTerms = { settlement: draft.settlement, maturity: draft.maturity, couponPercent: inputNumber(draft.coupon, "Coupon", true),
33
42
  frequency: Number(draft.frequency) as BondTerms["frequency"], dayCount: draft.dayCount as BondTerms["dayCount"], endOfMonth: draft.endOfMonth };
34
- const quote = inputNumber(draft.quote, draft.mode === "yield" ? "Yield" : "Clean price");
43
+ const quote = draft.mode === "yield" ? inputNumber(draft.quote, "Yield", true) : inputNumber(draft.quote, "Clean price");
35
44
  const yieldPercent = draft.mode === "yield" ? quote : solveBondYield(terms, quote);
36
45
  const analytics = priceBond(terms, yieldPercent);
37
46
  const spread = treasurySpread(terms, yieldPercent, curve);
@@ -122,7 +122,7 @@ export function BondCalculatorPane({ focused, width, height }: PaneProps) {
122
122
  [{ label: "Clean price", value: fixed(result.analytics.cleanPrice) }, { label: "Yield", value: `${fixed(result.analytics.yieldPercent)}%` }],
123
123
  [{ label: "Dirty price", value: fixed(result.analytics.dirtyPrice) }, { label: "Accrued", value: fixed(result.analytics.accruedInterest) }],
124
124
  [{ label: "Macaulay", value: `${fixed(result.analytics.macaulayDuration)} yr` }, { label: "Modified", value: `${fixed(result.analytics.modifiedDuration)} yr` }],
125
- [{ label: "Convexity", value: `${fixed(result.analytics.convexity)} yr²` }, { label: "DV01 / 100", value: fixed(result.analytics.dv01, 6) }],
125
+ [{ label: "Convexity", value: `${fixed(result.analytics.convexity)} yr²` }, { label: "DV01", value: `${fixed(result.analytics.dv01, 6)} per 100 face` }],
126
126
  ] : [];
127
127
  return <Box flexDirection="column" width={width} height={height}>
128
128
  {tabStrip}
@@ -2,6 +2,7 @@ import { useMemo, useRef } from "react";
2
2
  import { usePaneFooter, type PaneFooterSegment, type PaneHint } from "../../../components";
3
3
  import { enableBrokerHint } from "../shared/broker-reconnect";
4
4
  import type { BrokerManagerMessage } from "./pane-actions";
5
+ import { logFailure } from "../../../utils/log-failure";
5
6
 
6
7
  interface BrokerManagerFooterActions {
7
8
  connectSelected: () => Promise<void>;
@@ -58,8 +59,8 @@ export function useBrokerManagerFooter({
58
59
  hints.push({ id: "edit", key: "e", label: "dit", onPress: () => actionsRef.current.startEdit() });
59
60
  if (disabledSelected === null) {
60
61
  hints.push(
61
- { id: "connect", key: "c", label: "onnect", onPress: () => actionsRef.current.connectSelected().catch(() => {}) },
62
- { id: "sync", key: "s", label: "ync", onPress: () => actionsRef.current.syncSelected().catch(() => {}) },
62
+ { id: "connect", key: "c", label: "onnect", onPress: () => actionsRef.current.connectSelected().catch(logFailure("broker-manager.footer", "Connect selected broker profile failed")) },
63
+ { id: "sync", key: "s", label: "ync", onPress: () => actionsRef.current.syncSelected().catch(logFailure("broker-manager.footer", "Sync selected broker profile failed")) },
63
64
  );
64
65
  }
65
66
  }
@@ -43,6 +43,7 @@ import {
43
43
  renderBrokerCell,
44
44
  type BrokerColumn,
45
45
  } from "./table";
46
+ import { logFailure } from "../../../utils/log-failure";
46
47
 
47
48
  export function BrokersPane({ focused, width, height }: PaneProps) {
48
49
  const language = useAppLanguage();
@@ -275,7 +276,7 @@ export function BrokersPane({ focused, width, height }: PaneProps) {
275
276
  }, []);
276
277
 
277
278
  const saveCurrentEdit = useCallback(() => {
278
- saveEdit().catch(() => {});
279
+ saveEdit().catch(logFailure("broker-manager", "Save broker profile edit failed"));
279
280
  }, [saveEdit]);
280
281
 
281
282
  // The detail insets one cell each side like the table cells.
@@ -1,6 +1,7 @@
1
1
  import { useShortcut, type KeyEventLike } from "../../../react/input";
2
2
  import { isPlainKey } from "../../../utils/keyboard";
3
3
  import type { BrokerEditKey } from "./detail";
4
+ import { logFailure } from "../../../utils/log-failure";
4
5
 
5
6
  /**
6
7
  * The edit form's keys beside its field ring (the detail's useFieldRing walks
@@ -48,7 +49,7 @@ export function useBrokerManagerKeyboard({
48
49
  }
49
50
  if (isPlainKey(event, "enter", "return")) {
50
51
  consume(event);
51
- saveEdit().catch(() => {});
52
+ saveEdit().catch(logFailure("broker-manager.keyboard", "Save broker form failed"));
52
53
  return;
53
54
  }
54
55
  if (onSelectRow && isPlainKey(event, "left", "h", "right", "l", "space")) {
@@ -1,11 +1,12 @@
1
1
  import { TextAttributes } from "../../../ui";
2
- import { TickerBadgeList, type DataTableCell } from "../../../components";
2
+ import type { DataTableCell } from "../../../components";
3
3
  import { colors } from "../../../theme/colors";
4
4
  import { formatRelativeTime } from "../../../utils/datetime-format";
5
5
  import {
6
- CompanyCell,
7
6
  FavoriteCell,
7
+ ListingBadges,
8
8
  } from "./detail";
9
+ import type { DatasetTicker } from "./detail/ui";
9
10
  import type { BuildoutColumn, BuildoutRow } from "./model/types";
10
11
  import {
11
12
  activityColor,
@@ -26,6 +27,19 @@ function moneyCell(value: string | null | undefined, color: string): DataTableCe
26
27
  return { text: moneyText(value), ...(amount == null ? {} : { value: amount }), color };
27
28
  }
28
29
 
30
+ /**
31
+ * The dataset's tickers in one cell: a chip for each the app can open, bold
32
+ * plain text for one it cannot read, and the same for every row of the column.
33
+ */
34
+ function tickerCell(tickers: readonly DatasetTicker[], width: number, selected: boolean): DataTableCell | null {
35
+ const symbols = tickers.flatMap((entry) => tickerSymbol(entry.ticker) ?? []);
36
+ if (symbols.length === 0) return null;
37
+ return {
38
+ text: symbols.join(" "),
39
+ content: <ListingBadges tickers={tickers} width={width} fallbackColor={selected ? colors.selectedText : colors.textBright} />,
40
+ };
41
+ }
42
+
29
43
  interface BuildoutCellContext {
30
44
  favoriteBusyKey: string | null;
31
45
  /** The row's last star did not take. */
@@ -78,17 +92,10 @@ export function renderBuildoutCell(
78
92
  ),
79
93
  };
80
94
  }
95
+ case "ticker":
96
+ return tickerCell([company], column.width, rowState.selected) ?? { text: "", value: null };
81
97
  case "company":
82
- return {
83
- text: company.ticker ? `${company.ticker} ${company.name}` : company.name,
84
- content: (
85
- <CompanyCell
86
- company={company}
87
- width={column.width}
88
- selected={rowState.selected}
89
- />
90
- ),
91
- };
98
+ return { text: company.name, color: colors.text };
92
99
  case "description":
93
100
  return { text: text(company.description), color: colors.textDim };
94
101
  case "sectorTech":
@@ -147,22 +154,9 @@ export function renderBuildoutCell(
147
154
  return { text: site.name, color: colors.text };
148
155
  case "type":
149
156
  return { text: text(site.type), color: colors.textDim };
150
- case "owner": {
151
- const ownerTicker = tickerSymbol(site.ownerTicker);
152
- if (ownerTicker) {
153
- return {
154
- text: ownerTicker,
155
- content: (
156
- <TickerBadgeList
157
- symbols={[ownerTicker]}
158
- width={column.width}
159
- fallbackColor={rowState.selected ? colors.selectedText : colors.textBright}
160
- />
161
- ),
162
- };
163
- }
164
- return { text: text(site.ownerName), color: colors.textDim };
165
- }
157
+ case "owner":
158
+ return tickerCell([{ ticker: site.ownerTicker }], column.width, rowState.selected)
159
+ ?? { text: text(site.ownerName), color: colors.textDim };
166
160
  case "location":
167
161
  return { text: text(location), color: colors.textDim };
168
162
  case "park":
@@ -185,23 +179,9 @@ export function renderBuildoutCell(
185
179
  switch (column.id) {
186
180
  case "time":
187
181
  return { text: formatRelativeTime(update.publishedAt), color: colors.textDim };
188
- case "companies": {
189
- const symbols = (update.companies ?? [])
190
- .map((company) => tickerSymbol(company.ticker))
191
- .filter((symbol): symbol is string => symbol != null);
192
- return symbols.length > 0
193
- ? {
194
- text: symbols.join(" "),
195
- content: (
196
- <TickerBadgeList
197
- symbols={symbols}
198
- width={column.width}
199
- fallbackColor={rowState.selected ? colors.selectedText : colors.textBright}
200
- />
201
- ),
202
- }
203
- : { text: text(update.companies?.map((company) => company.name).filter(Boolean).join(", ")), color: colors.textDim };
204
- }
182
+ case "companies":
183
+ return tickerCell(update.companies ?? [], column.width, rowState.selected)
184
+ ?? { text: text(update.companies?.map((company) => company.name).filter(Boolean).join(", ")), color: colors.textDim };
205
185
  case "headline":
206
186
  return { text: update.headline, color: colors.text };
207
187
  }
@@ -1,4 +1,4 @@
1
- import { Section, TickerBadgeList } from "../../../../components";
1
+ import { Section } from "../../../../components";
2
2
  import { ClippedText } from "../../../../components/ui/display";
3
3
  import { formatMarketPriceWithCurrency, liveQuoteFormatOptions } from "../../../../market-data/market/format";
4
4
  import { useInlineTickerQuote } from "../../../../state/hooks/inline-tickers";
@@ -11,7 +11,7 @@ import { formatCompact } from "../../../../utils/format";
11
11
  import { truncateWithEllipsis } from "../../../../utils/text-wrap";
12
12
  import { activityLabel, criticalityColor, dateShort, metricColor, metricNumber, textOrNull, tickerSymbol } from "../format";
13
13
  import type { BuildoutCompany } from "../model/types";
14
- import { DetailListLine, DetailSpecGrid, MarkdownBlock, RelatedCompaniesLine, type DetailSpec, type InlineTickerCatalog } from "./ui";
14
+ import { DetailListLine, DetailSpecGrid, ListingBadges, MarkdownBlock, RelatedCompaniesLine, type DetailSpec, type InlineTickerCatalog } from "./ui";
15
15
  import { dateCell, detailListValues, recommendationColor, valueWithOriginal } from "./values";
16
16
  import { regularSessionValuationPrice } from "../../../../market-data/quotes/regular-session-valuation";
17
17
 
@@ -116,7 +116,7 @@ export function CompanyDetail({
116
116
  <>
117
117
  {company.ticker ? (
118
118
  <Box flexDirection="row" height={1}>
119
- <TickerBadgeList symbols={[company.ticker]} width={Math.min(bodyWidth, 16)} />
119
+ <ListingBadges tickers={[company]} width={Math.min(bodyWidth, 16)} />
120
120
  </Box>
121
121
  ) : null}
122
122
  <CompanyOverviewGrid
@@ -7,8 +7,8 @@ import { SiteDetail } from "./site";
7
7
  import { IntelDetail } from "./intel";
8
8
 
9
9
  export {
10
- CompanyCell,
11
10
  FavoriteCell,
11
+ ListingBadges,
12
12
  } from "./ui";
13
13
 
14
14
  export function BuildoutDetail({
@@ -1,10 +1,10 @@
1
- import { Badge, TickerBadgeList } from "../../../../components";
1
+ import { Badge } from "../../../../components";
2
2
  import { RemoteImage } from "../../../../components/ui";
3
3
  import { colors } from "../../../../theme/colors";
4
4
  import { Box, Text } from "../../../../ui";
5
- import { dateDetail, intelSourceDomains, tickerSymbol } from "../format";
5
+ import { dateDetail, intelSourceDomains } from "../format";
6
6
  import type { BuildoutRow } from "../model/types";
7
- import { InlineSources, MarkdownBlock, type InlineTickerCatalog } from "./ui";
7
+ import { InlineSources, ListingBadges, MarkdownBlock, type InlineTickerCatalog } from "./ui";
8
8
 
9
9
  type BuildoutIntel = Extract<BuildoutRow, { kind: "intel" }>["item"];
10
10
 
@@ -29,10 +29,7 @@ export function IntelDetail({
29
29
  </Box>
30
30
  {(item.companies?.length ?? 0) > 0 && (
31
31
  <Box marginTop={1} height={1}>
32
- <TickerBadgeList
33
- symbols={item.companies!.map((company) => tickerSymbol(company.ticker) ?? "")}
34
- width={Math.min(bodyWidth, 56)}
35
- />
32
+ <ListingBadges tickers={item.companies!} width={Math.min(bodyWidth, 56)} />
36
33
  </Box>
37
34
  )}
38
35
  {item.imageUrl ? (
@@ -1,11 +1,11 @@
1
- import { Section, TickerBadgeList } from "../../../../components";
1
+ import { Section } from "../../../../components";
2
2
  import { colors } from "../../../../theme/colors";
3
3
  import { Box, Text } from "../../../../ui";
4
4
  import { truncateWithEllipsis } from "../../../../utils/text-wrap";
5
5
  import { activityColor, activityLabel, dateShort, sourceDomains } from "../format";
6
6
  import type { BuildoutSite } from "../model/types";
7
7
  import { SiteSatelliteImages } from "./satellite-images";
8
- import { DetailSpecGrid, InlineSources, MarkdownBlock, SourceDetailLines, type InlineTickerCatalog } from "./ui";
8
+ import { DetailSpecGrid, InlineSources, ListingBadges, MarkdownBlock, SourceDetailLines, type InlineTickerCatalog } from "./ui";
9
9
  import { booleanText, dateCell, metadataSpecs, reportSectionText } from "./values";
10
10
 
11
11
  export function SiteDetail({
@@ -28,7 +28,7 @@ export function SiteDetail({
28
28
  <>
29
29
  {site.ownerTicker ? (
30
30
  <Box flexDirection="row" height={1}>
31
- <TickerBadgeList symbols={[site.ownerTicker]} width={Math.min(bodyWidth, 16)} />
31
+ <ListingBadges tickers={[{ ticker: site.ownerTicker }]} width={Math.min(bodyWidth, 16)} />
32
32
  </Box>
33
33
  ) : null}
34
34
  <DetailSpecGrid
@@ -99,7 +99,7 @@ export function SiteDetail({
99
99
  <Box key={`${builder.companyName}-${index}`} flexDirection="column" marginTop={index === 0 ? 0 : 1}>
100
100
  <Box flexDirection="row" height={1}>
101
101
  {builder.companyTicker
102
- ? <TickerBadgeList symbols={[builder.companyTicker]} width={Math.min(12, bodyWidth)} />
102
+ ? <ListingBadges tickers={[{ ticker: builder.companyTicker }]} width={Math.min(12, bodyWidth)} />
103
103
  : null}
104
104
  <Text fg={colors.textMuted}>
105
105
  {truncateWithEllipsis(`${builder.companyName ?? "Company"}${builder.role ? ` - ${builder.role}` : ""}`, Math.max(0, bodyWidth - (builder.companyTicker ? 12 : 0)))}
@@ -1,3 +1,4 @@
1
+ import { useMemo } from "react";
1
2
  import { TickerBadgeList } from "../../../../components";
2
3
  import { MarkdownText } from "../../../../components/markdown-text";
3
4
  import { Button } from "../../../../components/ui/button";
@@ -7,8 +8,8 @@ import type { InlineTickerCatalogEntry } from "../../../../state/hooks/inline-ti
7
8
  import { colors } from "../../../../theme/colors";
8
9
  import { Box, Text, TextAttributes } from "../../../../ui";
9
10
  import { truncateWithEllipsis } from "../../../../utils/text-wrap";
10
- import { sourceDetailEntries, text, textOrNull, tickerSymbol } from "../format";
11
- import type { BuildoutCompany, BuildoutRelatedCompany, BuildoutSource } from "../model/types";
11
+ import { listingKey, sourceDetailEntries, text, textOrNull, tickerSymbol } from "../format";
12
+ import type { BuildoutRelatedCompany, BuildoutSource } from "../model/types";
12
13
 
13
14
  export type InlineTickerCatalog = Record<string, InlineTickerCatalogEntry>;
14
15
 
@@ -80,6 +81,38 @@ export function DetailListLine({
80
81
  );
81
82
  }
82
83
 
84
+ /** A ticker as the dataset writes it, with the venue it names when it names one. */
85
+ export interface DatasetTicker {
86
+ ticker?: string | null;
87
+ exchange?: string | null;
88
+ }
89
+
90
+ /**
91
+ * The dataset's tickers, drawn one way: a chip for each the app can look up,
92
+ * price and open, a number-only Asian listing through the venue the dataset
93
+ * names, and bold plain text for one it cannot read. Never a chip that skips
94
+ * the lookup and so looks different from the resolved ones.
95
+ */
96
+ export function ListingBadges({ tickers, width, fallbackColor = colors.textBright }: {
97
+ tickers: readonly DatasetTicker[];
98
+ width: number;
99
+ fallbackColor?: string;
100
+ }) {
101
+ const { symbols, listings } = useMemo(() => {
102
+ const shown: string[] = [];
103
+ const known: Record<string, string | null> = {};
104
+ for (const entry of tickers) {
105
+ const symbol = tickerSymbol(entry.ticker);
106
+ if (!symbol) continue;
107
+ shown.push(symbol);
108
+ const key = listingKey(entry.ticker, entry.exchange);
109
+ if (key !== symbol) known[symbol] = key;
110
+ }
111
+ return { symbols: shown, listings: known };
112
+ }, [tickers]);
113
+ return <TickerBadgeList symbols={symbols} width={width} fallbackColor={fallbackColor} listings={listings} />;
114
+ }
115
+
83
116
  export function RelatedCompaniesLine({
84
117
  label,
85
118
  companies,
@@ -93,25 +126,19 @@ export function RelatedCompaniesLine({
93
126
  if (items.length === 0) return null;
94
127
 
95
128
  const visible = items.slice(0, 8);
96
- const symbols = visible
97
- .map((company) => tickerSymbol(company.ticker))
98
- .filter((symbol): symbol is string => symbol != null);
129
+ const withTicker = visible.filter((company) => tickerSymbol(company.ticker) != null);
99
130
  const names = visible
100
131
  .filter((company) => !tickerSymbol(company.ticker))
101
132
  .map((company) => textOrNull(company.name))
102
133
  .filter((name): name is string => name != null);
103
134
  const overflow = items.length > visible.length ? ` +${items.length - visible.length}` : "";
104
135
  const prefix = `${label}: `;
105
- const badgeWidth = Math.min(Math.max(0, width - prefix.length - (names.length > 0 ? 1 : 0)), Math.max(0, symbols.length * 9));
136
+ const badgeWidth = Math.min(Math.max(0, width - prefix.length - (names.length > 0 ? 1 : 0)), Math.max(0, withTicker.length * 9));
106
137
  return (
107
138
  <Box flexDirection="row" width={width} height={1} overflow="hidden">
108
139
  <Text fg={colors.textMuted}>{prefix}</Text>
109
- {symbols.length > 0 ? (
110
- <TickerBadgeList
111
- symbols={symbols}
112
- width={badgeWidth}
113
- fallbackColor={colors.textBright}
114
- />
140
+ {withTicker.length > 0 ? (
141
+ <ListingBadges tickers={withTicker} width={badgeWidth} />
115
142
  ) : null}
116
143
  <ClippedText fg={colors.textDim} text={`${names.length > 0 ? names.join(", ") : ""}${overflow}`} width={Math.max(0, width - prefix.length - badgeWidth)} cut={truncateWithEllipsis} />
117
144
  </Box>
@@ -207,29 +234,3 @@ export function FavoriteCell({
207
234
  >{failed && !busy ? <Text fg={colors.negative} attributes={TextAttributes.BOLD}>!</Text> : undefined}</Button>
208
235
  );
209
236
  }
210
-
211
- export function CompanyCell({
212
- company,
213
- width,
214
- selected,
215
- }: {
216
- company: BuildoutCompany;
217
- width: number;
218
- selected: boolean;
219
- }) {
220
- const symbol = tickerSymbol(company.ticker);
221
- if (!symbol) {
222
- return <ClippedText fg={selected ? colors.selectedText : colors.text} text={company.name} width={width} cut={truncateWithEllipsis} />;
223
- }
224
- const badgeWidth = Math.min(11, width);
225
- return (
226
- <Box flexDirection="row" width={width} height={1} overflow="hidden">
227
- <TickerBadgeList
228
- symbols={[symbol]}
229
- width={badgeWidth}
230
- fallbackColor={selected ? colors.selectedText : colors.textBright}
231
- />
232
- <ClippedText fg={selected ? colors.selectedText : colors.text} text={company.name} width={Math.max(0, width - badgeWidth)} cut={truncateWithEllipsis} />
233
- </Box>
234
- );
235
- }
@@ -1,4 +1,6 @@
1
1
  import { colors, priceColor } from "../../../theme/colors";
2
+ import { collectUniqueTickerSymbols } from "../../../tickers/tokenizer";
3
+ import { isKnownExchangeCode } from "../../../utils/exchanges";
2
4
  import { formatDetailDate as sharedFormatDetailDate, parseDisplayDate } from "../../../utils/datetime-format";
3
5
  import type { BuildoutSource, BuildoutUpdate } from "./model/types";
4
6
 
@@ -141,9 +143,29 @@ export function tickerSymbol(value: string | null | undefined): string | null {
141
143
  return symbol ? symbol.toUpperCase() : null;
142
144
  }
143
145
 
146
+ /**
147
+ * The key the app looks a dataset ticker up and opens it by. A name-led
148
+ * symbol (NVDA, BRK.B) is its own. The dataset writes some Asian listings by
149
+ * number alone (2330, 005930), which a cashtag reads as money, so one takes
150
+ * the venue the dataset names (2330:TWSE, 005930:KRX). Null when the dataset
151
+ * names no venue the app knows: such a ticker is plain text, never a chip
152
+ * that looks different from the resolved ones around it.
153
+ */
154
+ export function listingKey(ticker: string | null | undefined, exchange?: string | null): string | null {
155
+ const symbol = tickerSymbol(ticker);
156
+ if (!symbol) return null;
157
+ let key: string | null = symbol;
158
+ if (!/^[A-Z]/.test(symbol)) {
159
+ const venue = tickerSymbol(exchange);
160
+ // `688795.SS` names its venue twice: the dataset's venue is the one kept.
161
+ key = venue && isKnownExchangeCode(venue) ? `${symbol.replace(/\.[A-Z]{1,4}$/, "")}:${venue}` : null;
162
+ }
163
+ return key && collectUniqueTickerSymbols([`$${key}`]).includes(key) ? key : null;
164
+ }
165
+
144
166
  export function tickerSearchText(symbols: readonly string[]) {
145
167
  return symbols
146
- .filter((symbol) => /^[A-Z]/.test(symbol))
168
+ .filter((symbol) => collectUniqueTickerSymbols([`$${symbol}`]).includes(symbol))
147
169
  .map((symbol) => `$${symbol}`)
148
170
  .join(" ");
149
171
  }
@@ -293,6 +293,7 @@ export type BuildoutColumnId =
293
293
  | "avgSectorGrowth"
294
294
  | "avgReturn1y"
295
295
  | "avgMargin"
296
+ | "ticker"
296
297
  | "company"
297
298
  | "description"
298
299
  | "sectorTech"
@@ -55,7 +55,7 @@ import {
55
55
  tabs,
56
56
  type BuildoutOpenTarget,
57
57
  } from "../table-model";
58
- import { tickerSearchText, tickerSymbol } from "../format";
58
+ import { listingKey, tickerSearchText, tickerSymbol } from "../format";
59
59
  import {
60
60
  activeBuildoutPage,
61
61
  renderBuildoutPageStatus,
@@ -70,12 +70,6 @@ const BUILDOUT_UPGRADE_URL = "https://thebuildout.ai/pricing";
70
70
  /** How long the cursor rests on a company before linked panes follow it. */
71
71
  const CURSOR_PUBLISH_MS = 150;
72
72
 
73
- /** A symbol the rest of the app can open: the dataset writes some Asian listings by number alone. */
74
- function linkableTicker(value: string | null | undefined): string | null {
75
- const symbol = tickerSymbol(value);
76
- return symbol && /^[A-Z][A-Z0-9.-]*$/.test(symbol) ? symbol : null;
77
- }
78
-
79
73
  function sameScope(left: GeoScope | null, right: GeoScope | null): boolean {
80
74
  return left?.key === right?.key && left?.label === right?.label;
81
75
  }
@@ -193,7 +187,7 @@ export function BuildoutPane({ focused, width, height }: PaneProps) {
193
187
  // Panes linked to this one follow the company under the cursor, and a linked map can widen to the
194
188
  // theme it belongs to. Off the company tabs both stay where they were.
195
189
  const cursorCompany = detailRow?.kind === "company" ? detailRow.item : selectedRow?.kind === "company" ? selectedRow.item : null;
196
- const cursorTicker = linkableTicker(cursorCompany?.ticker);
190
+ const cursorTicker = cursorCompany ? listingKey(cursorCompany.ticker, cursorCompany.exchange) : null;
197
191
  // Published once the cursor rests: arrowing down a theme would otherwise load every company it passes.
198
192
  useEffect(() => {
199
193
  if (!cursorTicker) return;