@gloom-sh/terminal 0.20.10 → 0.20.12

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 (324) hide show
  1. package/package.json +2 -1
  2. package/patches/@opentui%2Fcore@0.3.2.patch +16 -0
  3. package/src/api-client/awards.ts +16 -0
  4. package/src/api-client/central-bank-rates.ts +5 -0
  5. package/src/api-client/data.ts +55 -2
  6. package/src/api-client/index.ts +18 -1
  7. package/src/api-client/request.ts +86 -3
  8. package/src/api-client/socket-connection.ts +366 -0
  9. package/src/api-client/socket-features.ts +75 -0
  10. package/src/api-client/socket-frames.ts +161 -0
  11. package/src/api-client/socket-listeners.ts +207 -0
  12. package/src/api-client/socket-quotes.ts +332 -0
  13. package/src/api-client/socket.ts +168 -983
  14. package/src/api-client/supply-chain-graph.ts +4 -2
  15. package/src/api-client/supply-chain.ts +8 -0
  16. package/src/api-client/types/econ.ts +10 -7
  17. package/src/api-client/types/filings-and-calls.ts +8 -0
  18. package/src/app/global-shortcuts.ts +2 -1
  19. package/src/app/keybindings/actions.ts +19 -0
  20. package/src/app/pane-runtime/index.tsx +18 -3
  21. package/src/app/pane-runtime/layout-placement.ts +63 -0
  22. package/src/app/pane-runtime/ticker-open-runtime.ts +10 -2
  23. package/src/brokers/signed-in/adapter.ts +19 -5
  24. package/src/brokers/signed-in/client.ts +13 -1
  25. package/src/brokers/signed-in/sign-in-dialog.tsx +33 -9
  26. package/src/capabilities/chart-series.ts +4 -1
  27. package/src/cli/board-coins.ts +10 -1
  28. package/src/cli/commands/crypto-hints.ts +3 -2
  29. package/src/cli/commands/fred-series.ts +0 -54
  30. package/src/cli/commands/market.ts +209 -31
  31. package/src/cli/commands/overview.ts +47 -14
  32. package/src/cli/commands/search.ts +37 -8
  33. package/src/cli/commands/ticker.ts +15 -4
  34. package/src/cli/desktop-pane-shot.ts +27 -2
  35. package/src/cli/fx-quote-rate.ts +1 -1
  36. package/src/cli/glossary.ts +14 -5
  37. package/src/cli/history-catalog-series.ts +85 -0
  38. package/src/cli/index.ts +1 -1
  39. package/src/cli/list-progress.ts +45 -0
  40. package/src/cli/listing-arg.ts +71 -7
  41. package/src/cli/name-entries.ts +8 -4
  42. package/src/cli/not-a-ticker.ts +2 -2
  43. package/src/cli/pane-functions/freshness.ts +50 -3
  44. package/src/cli/pane-functions/index.ts +7 -4
  45. package/src/cli/pane-functions/market-session.ts +66 -14
  46. package/src/cli/pane-functions/options.ts +5 -0
  47. package/src/cli/pane-functions/resolver.ts +9 -2
  48. package/src/cli/pane-functions/screenshot-assessment.ts +28 -3
  49. package/src/cli/pane-functions/screenshot-types.ts +6 -0
  50. package/src/cli/quote-answer.ts +49 -10
  51. package/src/cli/quote-list-reads.ts +87 -0
  52. package/src/cli/report-tables.ts +70 -13
  53. package/src/cli/result.ts +24 -2
  54. package/src/cli/symbol-list.ts +31 -4
  55. package/src/cli/terminal-code-hints.ts +83 -0
  56. package/src/cli/ticker-resolution.ts +2 -1
  57. package/src/cli/treasury-yields.ts +5 -0
  58. package/src/components/chart/native/kitty/manager.ts +2 -0
  59. package/src/components/chart/native/surface/manager.ts +211 -11
  60. package/src/components/command-bar/action-runtime.ts +2 -0
  61. package/src/components/command-bar/panel/index.tsx +2 -13
  62. package/src/components/command-bar/panel/layout.ts +1 -7
  63. package/src/components/command-bar/panel/runtime.ts +0 -1
  64. package/src/components/command-bar/panel/types.ts +0 -2
  65. package/src/components/command-bar/routing/launch-request.ts +2 -1
  66. package/src/components/command-bar/routing/navigation-state.ts +4 -2
  67. package/src/components/command-bar/workflow/types.ts +6 -0
  68. package/src/components/data-table/column-menu.tsx +89 -0
  69. package/src/components/data-table/sort-menu.tsx +9 -2
  70. package/src/components/data-table/view.tsx +33 -6
  71. package/src/components/form-modal/content.tsx +10 -0
  72. package/src/components/index.ts +1 -1
  73. package/src/components/layout/detached-pane-shell.tsx +3 -0
  74. package/src/components/layout/double-escape-close.ts +34 -3
  75. package/src/components/layout/floating-pane.tsx +10 -4
  76. package/src/components/layout/pane/cycle-order.ts +66 -2
  77. package/src/components/layout/pane/footer/index.tsx +25 -11
  78. package/src/components/layout/pane/footer/model.ts +62 -20
  79. package/src/components/layout/pane/header.tsx +140 -31
  80. package/src/components/layout/pane/sidebar.tsx +138 -20
  81. package/src/components/layout/pane/status-footer.ts +3 -1
  82. package/src/components/layout/shell/active-drag.ts +18 -13
  83. package/src/components/layout/shell/drag/magnets.ts +34 -18
  84. package/src/components/layout/shell/drag/runtime.ts +5 -0
  85. package/src/components/layout/shell/index.tsx +25 -0
  86. package/src/components/layout/shell/menu.ts +9 -0
  87. package/src/components/layout/shell/pane/actions.ts +36 -0
  88. package/src/components/layout/shell/pane/management-shortcuts.ts +27 -3
  89. package/src/components/layout/shell/pane-occlusion.ts +40 -0
  90. package/src/components/layout/shell/shortcuts.ts +17 -1
  91. package/src/components/layout/shell/terminal-pointer-runtime.ts +39 -6
  92. package/src/components/layout/shell/window-mode/index.ts +5 -16
  93. package/src/components/layout/shell/window-mode/overlays.tsx +3 -1
  94. package/src/components/market-board/index.tsx +14 -5
  95. package/src/components/metric-treemap/index.tsx +3 -1
  96. package/src/components/ticker/list-table-view.tsx +5 -0
  97. package/src/components/ui/button.tsx +48 -4
  98. package/src/components/ui/data-table/column-order.ts +180 -0
  99. package/src/components/ui/data-table/index.tsx +12 -1
  100. package/src/components/ui/data-table/opentui/index.tsx +291 -32
  101. package/src/components/ui/data-table/opentui/model.ts +43 -4
  102. package/src/components/ui/data-table/types.ts +56 -0
  103. package/src/components/ui/data-table/use-column-order.ts +135 -0
  104. package/src/components/ui/index.ts +1 -1
  105. package/src/components/ui/inline-quick-add.tsx +19 -3
  106. package/src/components/ui/list-view.tsx +11 -5
  107. package/src/components/ui/query-bar.tsx +16 -1
  108. package/src/components/ui/selection-fill.ts +39 -0
  109. package/src/components/ui/table-layout.ts +120 -0
  110. package/src/core/state/app/layout-reducer.ts +2 -1
  111. package/src/core/state/app/pane-choices.ts +68 -0
  112. package/src/core/state/app/state.ts +14 -6
  113. package/src/core/state/app/types.ts +8 -0
  114. package/src/docs/snapshot.json +3 -2
  115. package/src/i18n/es.ts +2 -0
  116. package/src/i18n/ja.ts +2 -0
  117. package/src/i18n/ko.ts +2 -0
  118. package/src/i18n/zh-cn.ts +2 -0
  119. package/src/i18n/zh-tw.ts +2 -0
  120. package/src/layout/pane-manager/dock-tree.ts +19 -0
  121. package/src/layout/pane-manager/index.ts +3 -0
  122. package/src/market-data/coordinator/index.ts +4 -3
  123. package/src/market-data/coordinator/quotes.ts +12 -4
  124. package/src/market-data/market/freshness.ts +33 -0
  125. package/src/market-data/market/status.ts +5 -1
  126. package/src/market-data/quotes/contributions.ts +10 -0
  127. package/src/market-data/quotes/freshness.ts +31 -0
  128. package/src/market-data/quotes/live-valuation.ts +32 -5
  129. package/src/market-data/quotes/regular-session-valuation.ts +1 -1
  130. package/src/market-data/quotes/resolution.ts +4 -0
  131. package/src/market-data/quotes/time.ts +0 -14
  132. package/src/plugins/builtin/account-management/index.tsx +1 -0
  133. package/src/plugins/builtin/awards/detail.tsx +12 -4
  134. package/src/plugins/builtin/awards/headless.ts +29 -8
  135. package/src/plugins/builtin/awards/model.ts +36 -2
  136. package/src/plugins/builtin/awards/pane.tsx +7 -4
  137. package/src/plugins/builtin/broker-manager/detail.tsx +5 -3
  138. package/src/plugins/builtin/broker-manager/index.tsx +7 -6
  139. package/src/plugins/builtin/broker-manager/model.ts +15 -6
  140. package/src/plugins/builtin/broker-manager/pane-actions.tsx +11 -4
  141. package/src/plugins/builtin/broker-manager/sign-in-end.ts +50 -19
  142. package/src/plugins/builtin/broker-manager/table.ts +10 -4
  143. package/src/plugins/builtin/broker-trading/index.tsx +1 -1
  144. package/src/plugins/builtin/central-bank-rates/headless.ts +6 -6
  145. package/src/plugins/builtin/central-bank-rates/index.tsx +1 -1
  146. package/src/plugins/builtin/central-bank-rates/model.ts +21 -3
  147. package/src/plugins/builtin/central-bank-rates/pane.tsx +15 -5
  148. package/src/plugins/builtin/chart-composer/headless.ts +5 -1
  149. package/src/plugins/builtin/chart-composer/pane.tsx +1 -0
  150. package/src/plugins/builtin/chat/content/handle-prompt.tsx +4 -0
  151. package/src/plugins/builtin/chat/controller/realtime.ts +17 -1
  152. package/src/plugins/builtin/chat/message/terminal.tsx +4 -1
  153. package/src/plugins/builtin/chat/sidebar.tsx +35 -19
  154. package/src/plugins/builtin/cloud/askg/pane.tsx +4 -0
  155. package/src/plugins/builtin/cloud/askg/tool-timeline.tsx +2 -0
  156. package/src/plugins/builtin/cloud/plugin.tsx +1 -0
  157. package/src/plugins/builtin/cloud/team/module.tsx +1 -0
  158. package/src/plugins/builtin/cloud/thesis/detail.tsx +9 -4
  159. package/src/plugins/builtin/commodity-balances/pane.tsx +13 -5
  160. package/src/plugins/builtin/company-kpis/model.ts +3 -3
  161. package/src/plugins/builtin/connections/index.ts +1 -0
  162. package/src/plugins/builtin/credit-boards/cdx-pane.tsx +9 -5
  163. package/src/plugins/builtin/credit-boards/client.ts +5 -0
  164. package/src/plugins/builtin/credit-boards/headless.ts +1 -6
  165. package/src/plugins/builtin/credit-boards/model.ts +0 -6
  166. package/src/plugins/builtin/credit-boards/series.ts +19 -8
  167. package/src/plugins/builtin/credit-boards/sovr-pane.tsx +9 -5
  168. package/src/plugins/builtin/crypto-etf-flows/headless.ts +23 -13
  169. package/src/plugins/builtin/crypto-etf-flows/pane.tsx +8 -3
  170. package/src/plugins/builtin/debt-maturities/headless.ts +16 -7
  171. package/src/plugins/builtin/debt-maturities/model.ts +9 -15
  172. package/src/plugins/builtin/debt-maturities/pane.tsx +9 -10
  173. package/src/plugins/builtin/earnings/board-model.ts +33 -4
  174. package/src/plugins/builtin/earnings/board.tsx +15 -3
  175. package/src/plugins/builtin/earnings/calendar.tsx +10 -6
  176. package/src/plugins/builtin/earnings/client.ts +0 -9
  177. package/src/plugins/builtin/earnings/headless.ts +10 -7
  178. package/src/plugins/builtin/earnings/history.tsx +21 -14
  179. package/src/plugins/builtin/earnings-calls/data.ts +24 -4
  180. package/src/plugins/builtin/earnings-calls/format.ts +23 -5
  181. package/src/plugins/builtin/earnings-calls/headless.ts +23 -3
  182. package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
  183. package/src/plugins/builtin/earnings-calls/model.ts +11 -1
  184. package/src/plugins/builtin/earnings-calls/pane.tsx +2 -5
  185. package/src/plugins/builtin/econ/calendar-model.ts +27 -0
  186. package/src/plugins/builtin/econ/fred-catalog.ts +3 -0
  187. package/src/plugins/builtin/econ/index.tsx +9 -2
  188. package/src/plugins/builtin/econ-statistics/headless.ts +3 -1
  189. package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
  190. package/src/plugins/builtin/equity-screener/live.ts +74 -18
  191. package/src/plugins/builtin/equity-screener/model.ts +19 -4
  192. package/src/plugins/builtin/equity-screener/pane.tsx +19 -14
  193. package/src/plugins/builtin/equity-screener/refresh-anchor.ts +45 -0
  194. package/src/plugins/builtin/equity-screener/results.ts +22 -2
  195. package/src/plugins/builtin/equity-screener/screen-check.ts +9 -3
  196. package/src/plugins/builtin/fear-greed/headless.ts +16 -13
  197. package/src/plugins/builtin/fear-greed/pane.tsx +12 -4
  198. package/src/plugins/builtin/filing-events/index.tsx +1 -0
  199. package/src/plugins/builtin/futures/index.tsx +15 -1
  200. package/src/plugins/builtin/futures/table.tsx +1 -1
  201. package/src/plugins/builtin/fx-matrix/index.tsx +32 -19
  202. package/src/plugins/builtin/holders/pane.tsx +30 -20
  203. package/src/plugins/builtin/insider/table.tsx +10 -7
  204. package/src/plugins/builtin/insider/tickers.tsx +1 -1
  205. package/src/plugins/builtin/iv-history/events.ts +5 -0
  206. package/src/plugins/builtin/iv-history/headless.ts +15 -9
  207. package/src/plugins/builtin/jobs/index.tsx +1 -0
  208. package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -0
  209. package/src/plugins/builtin/macro-day/headless.ts +15 -6
  210. package/src/plugins/builtin/macro-day/model.ts +1 -1
  211. package/src/plugins/builtin/macro-day/releases.ts +25 -16
  212. package/src/plugins/builtin/market-movers/index.tsx +20 -8
  213. package/src/plugins/builtin/market-movers/model.ts +5 -0
  214. package/src/plugins/builtin/market-movers/session-body.tsx +2 -1
  215. package/src/plugins/builtin/money-markets/headless.ts +12 -2
  216. package/src/plugins/builtin/money-markets/pane.tsx +10 -1
  217. package/src/plugins/builtin/options/view.tsx +3 -0
  218. package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
  219. package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
  220. package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -1
  221. package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -31
  222. package/src/plugins/builtin/portfolio-list/pane/index.tsx +19 -1
  223. package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +22 -8
  224. package/src/plugins/builtin/portfolio-list/summary/index.tsx +6 -8
  225. package/src/plugins/builtin/portfolio-list/table.tsx +15 -1
  226. package/src/plugins/builtin/rate-path/pane.tsx +2 -0
  227. package/src/plugins/builtin/realized-vol/headless.ts +28 -2
  228. package/src/plugins/builtin/revenue-breakdown/pane.tsx +2 -0
  229. package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -1
  230. package/src/plugins/builtin/risk-factors/index.tsx +1 -0
  231. package/src/plugins/builtin/seasonality/pane.tsx +2 -1
  232. package/src/plugins/builtin/shared/source-footer.ts +70 -0
  233. package/src/plugins/builtin/short-interest/publications-pane.tsx +5 -1
  234. package/src/plugins/builtin/short-volume/pane.tsx +5 -1
  235. package/src/plugins/builtin/social-mentions/outliers.tsx +10 -1
  236. package/src/plugins/builtin/social-mentions/pane.tsx +7 -0
  237. package/src/plugins/builtin/supply-chain/client.ts +3 -1
  238. package/src/plugins/builtin/supply-chain/flow.tsx +25 -8
  239. package/src/plugins/builtin/supply-chain/graph-client.ts +1 -1
  240. package/src/plugins/builtin/supply-chain/graph-evidence.ts +1 -1
  241. package/src/plugins/builtin/supply-chain/graph-model.ts +12 -1
  242. package/src/plugins/builtin/supply-chain/graph-pane.tsx +9 -8
  243. package/src/plugins/builtin/supply-chain/graph.tsx +12 -6
  244. package/src/plugins/builtin/supply-chain/headless.ts +13 -7
  245. package/src/plugins/builtin/supply-chain/model.ts +68 -11
  246. package/src/plugins/builtin/supply-chain/pane.tsx +9 -6
  247. package/src/plugins/builtin/supply-chain/row-evidence.tsx +5 -5
  248. package/src/plugins/builtin/thirteenf/pane.tsx +2 -0
  249. package/src/plugins/builtin/ticker-detail/financials/model.ts +28 -6
  250. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +26 -9
  251. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +58 -35
  252. package/src/plugins/builtin/ticker-detail/overview/components.tsx +14 -1
  253. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +2 -0
  254. package/src/plugins/builtin/ticker-detail/pane.tsx +48 -24
  255. package/src/plugins/builtin/ticker-detail/quote-footer.ts +5 -0
  256. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +6 -3
  257. package/src/plugins/builtin/treasury-auctions/after.ts +50 -23
  258. package/src/plugins/builtin/treasury-auctions/cache.ts +23 -5
  259. package/src/plugins/builtin/treasury-auctions/headless.ts +226 -37
  260. package/src/plugins/builtin/treasury-auctions/hk-headless.ts +11 -5
  261. package/src/plugins/builtin/treasury-auctions/hk-view.tsx +27 -25
  262. package/src/plugins/builtin/treasury-auctions/hk.ts +60 -8
  263. package/src/plugins/builtin/treasury-auctions/index.tsx +3 -0
  264. package/src/plugins/builtin/treasury-auctions/keys.ts +27 -0
  265. package/src/plugins/builtin/treasury-auctions/like.ts +137 -0
  266. package/src/plugins/builtin/treasury-auctions/model.ts +100 -22
  267. package/src/plugins/builtin/treasury-auctions/pane.tsx +39 -11
  268. package/src/plugins/builtin/vol-surface/heat-grid.tsx +6 -3
  269. package/src/plugins/builtin/vol-surface/pane.tsx +7 -3
  270. package/src/plugins/builtin/world-indices/index.tsx +5 -1
  271. package/src/plugins/builtin/yield-curve/index.tsx +2 -1
  272. package/src/plugins/runtime/index.tsx +1 -0
  273. package/src/plugins/runtime/state.ts +20 -0
  274. package/src/portfolio/column-values.ts +8 -2
  275. package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
  276. package/src/public/react.ts +7 -0
  277. package/src/react/auto-refresh.ts +29 -0
  278. package/src/renderers/browser/deeplink-bridge.ts +24 -3
  279. package/src/renderers/dom/data-table/column-drag.ts +147 -0
  280. package/src/renderers/dom/data-table/index.tsx +22 -0
  281. package/src/renderers/dom/data-table/row.tsx +27 -5
  282. package/src/renderers/dom/desktop/query-bar.tsx +229 -60
  283. package/src/renderers/dom/host/overflow-fade-px.ts +2 -0
  284. package/src/renderers/dom/host/overflow-fade.ts +1 -2
  285. package/src/renderers/dom/styles.css +47 -5
  286. package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +2 -1
  287. package/src/renderers/opentui/chart-surface.tsx +1 -0
  288. package/src/renderers/opentui/frame-hits.ts +33 -0
  289. package/src/renderers/opentui/host.tsx +2 -0
  290. package/src/renderers/opentui/native-surface.ts +14 -21
  291. package/src/renderers/opentui/test-utils.tsx +3 -0
  292. package/src/series/types.ts +2 -0
  293. package/src/sources/gloomberb-cloud/fred-attribution.ts +86 -0
  294. package/src/sources/gloomberb-cloud/index.ts +25 -1
  295. package/src/sources/gloomberb-cloud/normalizers.ts +22 -3
  296. package/src/sources/provider-errors.ts +64 -1
  297. package/src/sources/provider-router/batches.ts +19 -0
  298. package/src/sources/provider-router/index.ts +7 -1
  299. package/src/state/app/context/index.tsx +46 -1
  300. package/src/state/pane-unsent-work.ts +47 -0
  301. package/src/test-support/app-store.ts +24 -1
  302. package/src/test-support/shell-pane-keys.tsx +5 -0
  303. package/src/test-support/telemetry-guard.ts +83 -0
  304. package/src/test-support/test-env.ts +12 -0
  305. package/src/theme/colors.ts +17 -1
  306. package/src/theme/ui-tokens.ts +50 -1
  307. package/src/tickers/listing-venues.ts +11 -1
  308. package/src/tickers/search/japanese-names.json +1 -0
  309. package/src/tickers/search/japanese-names.ts +152 -0
  310. package/src/tickers/terminal-codes.ts +55 -6
  311. package/src/time-series/base-series.ts +3 -0
  312. package/src/time-series/live-quotes.ts +3 -9
  313. package/src/types/data-provider.ts +6 -0
  314. package/src/types/financials.ts +11 -0
  315. package/src/types/plugin-contributions.ts +7 -0
  316. package/src/types/plugin-panes.ts +7 -0
  317. package/src/ui/host.tsx +24 -0
  318. package/src/ui/pointer-drag.ts +11 -2
  319. package/src/utils/double-escape-close.ts +42 -0
  320. package/src/utils/fundamentals.ts +14 -3
  321. package/src/utils/fx-status.ts +30 -7
  322. package/src/utils/network-failure.ts +23 -0
  323. package/src/utils/share-multiples.cases.json +780 -2
  324. package/src/utils/share-multiples.ts +154 -24
@@ -13,7 +13,12 @@ import { formatPercentileRank } from "../../../utils/format";
13
13
  import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
14
14
  import { useResearchCloudSession } from "../shared/research-cloud-session";
15
15
  import { getCachedCentralBankRates, loadCentralBankRates } from "./client";
16
- import { hasNoPolicyRate, policyBoardRow, policyChange, policyChangeDate, policyHistory, policyLevel, policyNotices, policyRate } from "./model";
16
+ import { centralBankRatesHeadless } from "./headless";
17
+ import { reportFooterSegment } from "../shared/source-footer";
18
+ import {
19
+ hasNoPolicyRate, policyBoardRow, policyChange, policyChangeDate, policyHistory, policyLevel, policyNotices, policyObservations, policyRate,
20
+ policySource,
21
+ } from "./model";
17
22
 
18
23
  const PANELS = [{ id: "main" }];
19
24
 
@@ -22,12 +27,15 @@ function PolicyDetail({ row, width, height, focused }: { row: CentralBankRow; wi
22
27
  const series = useMemo(() => [staticSeries(history.map((point) => ({ date: new Date(point.date), observedAt: new Date(point.date), value: point.value })),
23
28
  { id: row.id, label: row.instrument, color: colors.positive, calendarSpaced: true, style: "step" })], [row, history]);
24
29
  const p = row.percentile;
30
+ // A bank whose terms ask it: the figures computed from its rates say so (the CBE's).
31
+ const computed = row.computedFrom ? `computed from ${row.computedFrom}` : null;
25
32
  // The chart shows the rank window, so the range carries no window or sample
26
33
  // count; short details keep the figures several to a row.
27
34
  const items: StatItem[] = [
28
35
  { id: "level", label: row.range ? "Target range" : "Policy rate", value: policyLevel(row),
29
- detail: formatPercentileRank(p.value, "1Y") },
30
- { id: "move", label: "Last change", value: policyChange(row), detail: policyChangeDate(row) ?? undefined },
36
+ detail: [formatPercentileRank(p.value, "1Y"), computed].filter(Boolean).join(" · ") },
37
+ { id: "move", label: "Last change", value: policyChange(row),
38
+ detail: [policyChangeDate(row), computed].filter(Boolean).join(" · ") || undefined },
31
39
  // A target range ranks and charts its midpoint, which the band's range would not say.
32
40
  { id: "range", label: "1Y range", value: `${policyRate(p.min)} to ${policyRate(p.max)}`, detail: row.range ? "midpoint" : undefined },
33
41
  { id: "asOf", label: "As of", value: row.asOf ?? "--", tone: row.status === "stale" ? "warning" : undefined,
@@ -38,7 +46,7 @@ function PolicyDetail({ row, width, height, focused }: { row: CentralBankRow; wi
38
46
  ...row.latestDecision === undefined ? [] : [{ id: "decided", label: row.latestDecision?.kind === "fixing" ? "Last fixing" : "Last decision",
39
47
  value: row.latestDecision?.date ?? "--" }],
40
48
  { id: "meeting", label: row.nextMeeting?.kind === "fixing" ? "Next fixing" : "Next meeting", value: row.nextMeeting?.date ?? "--" },
41
- { id: "source", label: "Source", value: row.source?.toUpperCase() ?? "--", detail: row.sourceSeriesIds.join(", ") || undefined },
49
+ { id: "source", label: "Source", value: policySource(row) ?? "--", detail: row.sourceSeriesIds.join(", ") || undefined },
42
50
  { id: "instrument", label: "Instrument", value: row.instrument, detail: row.centralBank ?? undefined, wide: true },
43
51
  ];
44
52
  return <StatChartDetail items={items} width={width} height={height} empty={!history.some((point) => point.value != null)}
@@ -63,7 +71,9 @@ export function CentralBankRatesPane({ width, height, focused }: PaneProps) {
63
71
  notices: [...(data ? policyNotices(data) : []), ...(resource.data?.refreshError ? [resource.data.refreshError] : [])] });
64
72
  usePaneStatusLinkFooter({ registrationId: "central-bank-rates", focused, loading: resource.loading, error: resource.error,
65
73
  url: selected?.observation.sourceUrl ?? null, showOpenHint: true,
66
- info: data && updatedAgo ? [ageFooterSegment(updatedAgo)] : [],
74
+ // Its sources and the rows' dates, as `fn CBR` ends; how long ago it loaded goes first on a narrow row.
75
+ info: data ? [reportFooterSegment(centralBankRatesHeadless, { sections: [], freshness: { observations: policyObservations(data) } }),
76
+ ...(updatedAgo ? [ageFooterSegment(updatedAgo)] : [])] : [],
67
77
  stale: !!data && resource.data?.stale,
68
78
  });
69
79
  return <Box width={width} height={height} flexDirection="column">
@@ -346,13 +346,17 @@ function releaseDay(value: unknown): string | null {
346
346
  * Who a chart cites when each of its series names its own dataset (CBR's
347
347
  * policy rates: `FRED series ECBDFR`); nothing, so Gloom Cloud, otherwise.
348
348
  */
349
- function seriesAttribution(series: readonly HeadlessSeries[]): Pick<HeadlessPaneFreshness, "source" | "publisher"> {
349
+ function seriesAttribution(series: readonly HeadlessSeries[]): Pick<HeadlessPaneFreshness, "source" | "publisher" | "publishedAt"> {
350
350
  const cited = series.map((entry) => (entry as HeadlessSeries & Pick<ResolvedSeries, "attribution">).attribution);
351
351
  if (!cited.length || cited.some((attribution) => !attribution)) return {};
352
352
  const publishers = [...new Set(cited.map((attribution) => attribution!.publisher))];
353
+ // The chart was published with its last series: the newest publication, when every series says when.
354
+ const published = cited.map((attribution) => attribution!.publishedAt);
355
+ const publishedAt = published.every(Boolean) ? (published as string[]).sort().at(-1) : undefined;
353
356
  return {
354
357
  source: [...new Set(cited.map((attribution) => attribution!.source))].join(", "),
355
358
  ...(publishers.every(Boolean) ? { publisher: publishers.join(", ") } : {}),
359
+ ...(publishedAt ? { publishedAt } : {}),
356
360
  };
357
361
  }
358
362
 
@@ -1313,6 +1313,7 @@ function ChartComposerSurface({
1313
1313
  ...totalReturnFilters,
1314
1314
  ]}
1315
1315
  view={resolutionOptions.length > 1 ? {
1316
+ label: "Interval",
1316
1317
  value: spec.viewport.resolution,
1317
1318
  options: resolutionOptions,
1318
1319
  onChange: (value: string) => setResolution(value as ChartResolution),
@@ -8,6 +8,7 @@ import { useShortcut } from "../../../../react/input";
8
8
  import { blendHex, colors } from "../../../../theme/colors";
9
9
  import { Box, Text, TextAttributes, type InputRenderable } from "../../../../ui";
10
10
  import { countEscapeTowardClose } from "../../../../utils/double-escape-close";
11
+ import { usePaneUnsentWork } from "../../../../state/pane-unsent-work";
11
12
  import { displayWidth } from "../../../../utils/format";
12
13
  import { truncateWithEllipsis } from "../../../../utils/text-wrap";
13
14
  import {
@@ -213,6 +214,9 @@ export function ChatHandlePrompt({
213
214
  menu: [{ id: "handle-not-now", label: t("Hide Handle Prompt"), onSelect: onDismiss }],
214
215
  } : null), [onDismiss, onFocusField, prompt.saving, prompt.visible]);
215
216
 
217
+ // A handle typed and not saved goes with the pane: Esc never closes it over one.
218
+ usePaneUnsentWork(prompt.visible && !prompt.saving && normalizeHandleInput(prompt.value).length > 0);
219
+
216
220
  useShortcut((event) => {
217
221
  if (event.name !== "escape") return;
218
222
  event.preventDefault?.();
@@ -27,7 +27,17 @@ interface ChatControllerRealtimeOptions {
27
27
  invalidateMentionCandidates: () => void;
28
28
  }
29
29
 
30
+ /**
31
+ * After a drop, the full-page reads wait a random moment up to this long. A
32
+ * server restart reconnects every client within about two seconds and each
33
+ * reads a page per channel it shows; spread out, they reach the server as a
34
+ * trickle. Only reactions, edits and removals made during the drop wait for
35
+ * it: the catch-up reads new messages as soon as the socket is back.
36
+ */
37
+ const CHAT_RESYNC_SPREAD_MS = 3_000;
38
+
30
39
  export class ChatControllerRealtime {
40
+ private resyncTimer: ReturnType<typeof setTimeout> | null = null;
31
41
  private verificationPollTimer: ReturnType<typeof setInterval> | null = null;
32
42
  private sessionRetryTimer: ReturnType<typeof setTimeout> | null = null;
33
43
  private safetyRefreshTimer: ReturnType<typeof setInterval> | null = null;
@@ -114,12 +124,18 @@ export class ChatControllerRealtime {
114
124
  }
115
125
  if (!dropped) return;
116
126
  dropped = false;
117
- this.options.resyncChannels();
127
+ if (this.resyncTimer) return;
128
+ this.resyncTimer = setTimeout(() => {
129
+ this.resyncTimer = null;
130
+ this.options.resyncChannels();
131
+ }, Math.random() * CHAT_RESYNC_SPREAD_MS);
118
132
  });
119
133
  }
120
134
  }
121
135
 
122
136
  stopRealtimeSubscriptions(): void {
137
+ if (this.resyncTimer) clearTimeout(this.resyncTimer);
138
+ this.resyncTimer = null;
123
139
  this.mentionCandidatesUnsubscribe?.();
124
140
  this.mentionCandidatesUnsubscribe = null;
125
141
  this.socketConnectionUnsubscribe?.();
@@ -8,6 +8,7 @@ import { ChatBotIcon } from "./person-icons";
8
8
  import { CHAT_PERSON_ICON_WIDTH } from "../people";
9
9
  import { ChatMessageActions, ChatMessageHeader } from "./header";
10
10
  import { Button } from "../../../../components/ui";
11
+ import { useSelectionFill } from "../../../../components/ui/selection-fill";
11
12
  import { canReactToMessage } from "../reactions";
12
13
  import { TerminalChatReactions } from "./reactions";
13
14
  import { TerminalChatMessageRow } from "./inline-tokens";
@@ -54,6 +55,7 @@ export function TerminalChatMessage({
54
55
  }: TerminalChatMessageProps) {
55
56
  const rendererHost = useRendererHost();
56
57
  const slowSend = useSlowPendingSend(msg);
58
+ const selectionFill = useSelectionFill();
57
59
  const canReact = reactionsEnabled && canReactToMessage(msg);
58
60
  const state = getChatMessageRenderState({
59
61
  msg,
@@ -92,7 +94,8 @@ export function TerminalChatMessage({
92
94
  const clearHovered = () => setHoveredIdx((current) => (current === index ? null : current));
93
95
  const messageRowProps = {
94
96
  width: contentWidth,
95
- backgroundColor: state.bgColor,
97
+ // The chosen message is quieter while the chat pane does not have the keys.
98
+ backgroundColor: state.isSelected ? selectionFill.bg : state.bgColor,
96
99
  onMouseOver: setHovered,
97
100
  onMouseOut: clearHovered,
98
101
  };
@@ -1,6 +1,6 @@
1
1
  import { ActionRow } from "../../../components/ui/action-row";
2
2
  import { Icon } from "../../../components/ui/icon";
3
- import { useMemo, useSyncExternalStore } from "react";
3
+ import { useMemo, useRef, useSyncExternalStore, type ReactNode } from "react";
4
4
  import {
5
5
  getPaneSidebarWidthRange,
6
6
  PaneSidebar,
@@ -8,9 +8,10 @@ import {
8
8
  PaneSidebarList,
9
9
  PaneSidebarRow,
10
10
  } from "../../../components";
11
- import { Box, Span, Text, useUiCapabilities } from "../../../ui";
11
+ import { usePaneSidebarReveal } from "../../../components/layout/pane/sidebar";
12
+ import { Box, Span, Text, useUiCapabilities, type BoxRenderable } from "../../../ui";
12
13
  import { TextAttributes } from "../../../ui";
13
- import { blendHex, colors } from "../../../theme/colors";
14
+ import { colors } from "../../../theme/colors";
14
15
  import { t } from "../../../i18n";
15
16
  import type { ChatChannel } from "../../../api-client";
16
17
  import { truncateWithEllipsis } from "../../../utils/text-wrap";
@@ -65,6 +66,22 @@ function ChannelNotificationIcon({
65
66
  );
66
67
  }
67
68
 
69
+ /** A section's header, kept in view while the keyboard's cursor is on it. */
70
+ function SectionHeaderRow({ width, cursor, backgroundColor, children }: {
71
+ width: number;
72
+ cursor: boolean;
73
+ backgroundColor: string;
74
+ children: ReactNode;
75
+ }) {
76
+ const ref = useRef<BoxRenderable>(null);
77
+ usePaneSidebarReveal(ref, cursor);
78
+ return (
79
+ <Box ref={ref} height={1} width={width} flexDirection="row" backgroundColor={backgroundColor}>
80
+ {children}
81
+ </Box>
82
+ );
83
+ }
84
+
68
85
  function ProfileIcon({
69
86
  color,
70
87
  onMouseDown,
@@ -182,13 +199,11 @@ export function ChannelSidebar({
182
199
  onResizeEnd: (nextWidth) => chatSidebarStore.commitWidth(nextWidth),
183
200
  } : undefined}
184
201
  >
185
- {({ backgroundColor: sidebarBg, listWidth }) => {
186
- const labelWidth = Math.max(listWidth - CHANNEL_ROW_INDENT - notificationWidth, 1);
187
- // The fill a keyboard-focused sidebar gives the row under its cursor.
188
- const cursorBackground = blendHex(colors.selected, colors.borderFocused, 0.32);
202
+ {({ backgroundColor: sidebarBg, listWidth: sidebarWidth, activeBackgroundColor: cursorBackground }) => {
203
+ // A heading under the cursor takes the fill the sidebar's own rows take there.
189
204
  // Every section reads the same: a caret, a label, and an optional
190
205
  // trailing action, so their channels can all share one indent.
191
- const sectionHeader = ({ key, label, fg, unread, expanded, onToggle, action }: {
206
+ const sectionHeader = (listWidth: number, { key, label, fg, unread, expanded, onToggle, action }: {
192
207
  key: string;
193
208
  label: string;
194
209
  fg?: string;
@@ -198,13 +213,13 @@ export function ChannelSidebar({
198
213
  action?: { ariaLabel: string; onPress: () => void };
199
214
  }) => {
200
215
  const rowWidth = Math.max(1, listWidth - (action ? SECTION_ACTION_WIDTH : 0));
216
+ const cursor = keyboardFocused && cursorHeaderKey === key;
201
217
  return (
202
- <Box
218
+ <SectionHeaderRow
203
219
  key={key}
204
- height={1}
205
220
  width={listWidth}
206
- flexDirection="row"
207
- backgroundColor={keyboardFocused && cursorHeaderKey === key ? cursorBackground : sidebarBg}
221
+ cursor={cursor}
222
+ backgroundColor={cursor ? cursorBackground : sidebarBg}
208
223
  >
209
224
  <ActionRow
210
225
  label={truncateWithEllipsis(label, Math.max(1, rowWidth - CHANNEL_ROW_INDENT))}
@@ -225,15 +240,16 @@ export function ChannelSidebar({
225
240
  )}
226
241
  </PaneSidebarAction>
227
242
  ) : null}
228
- </Box>
243
+ </SectionHeaderRow>
229
244
  );
230
245
  };
231
246
  return (
232
247
  <>
233
248
  <PaneSidebarList>
234
- {sidebarRows.map((row) => {
249
+ {({ listWidth }) => sidebarRows.map((row) => {
250
+ const labelWidth = Math.max(listWidth - CHANNEL_ROW_INDENT - notificationWidth, 1);
235
251
  if (row.kind === "public-header") {
236
- return sectionHeader({
252
+ return sectionHeader(listWidth, {
237
253
  key: row.key,
238
254
  label: "Channels",
239
255
  unread: hasUnread(row.channels),
@@ -243,7 +259,7 @@ export function ChannelSidebar({
243
259
  }
244
260
  if (row.kind === "team-header") {
245
261
  const canAddChannel = !!row.team && !!onCreateTeamChannel;
246
- return sectionHeader({
262
+ return sectionHeader(listWidth, {
247
263
  key: row.key,
248
264
  label: row.team ? `${teamPrefix(row.team)} ${row.team.name}` : "Team",
249
265
  fg: row.team ? teamAccentHex(row.team.accentColor) : colors.textDim,
@@ -259,7 +275,7 @@ export function ChannelSidebar({
259
275
  });
260
276
  }
261
277
  if (row.kind === "direct-header") {
262
- return sectionHeader({
278
+ return sectionHeader(listWidth, {
263
279
  key: row.key,
264
280
  label: "DMs",
265
281
  unread: hasUnread(row.channels),
@@ -325,7 +341,7 @@ export function ChannelSidebar({
325
341
  <Text fg={foregroundColor} selectable={false} onMouseDown={onMouseDown}> </Text>
326
342
  <ProfileIcon color={foregroundColor} onMouseDown={onMouseDown} />
327
343
  <Text fg={foregroundColor} selectable={false} onMouseDown={onMouseDown}>
328
- {` ${truncateWithEllipsis(t("Profile"), Math.max(listWidth - 3, 1))}`}
344
+ {` ${truncateWithEllipsis(t("Profile"), Math.max(sidebarWidth - 3, 1))}`}
329
345
  </Text>
330
346
  <Box flexGrow={1} onMouseDown={onMouseDown} />
331
347
  </>
@@ -333,7 +349,7 @@ export function ChannelSidebar({
333
349
  </PaneSidebarRow>
334
350
  )}
335
351
  {loading && focused && (
336
- <Box height={1} width={listWidth} flexDirection="row">
352
+ <Box height={1} width={sidebarWidth} flexDirection="row">
337
353
  <Text fg={colors.textDim}>{` ${t("syncing")}`}</Text>
338
354
  </Box>
339
355
  )}
@@ -44,6 +44,7 @@ import {
44
44
  usePaneAppConfig,
45
45
  } from "../../../../state/app/context";
46
46
  import { usePaneSession, usePaneSessionState } from "../../../../state/pane-session";
47
+ import { usePaneUnsentWork } from "../../../../state/pane-unsent-work";
47
48
  import { useInlineTickers } from "../../../../state/hooks/inline-tickers";
48
49
  import { useRemoteControlHandler } from "../../../../remote/app-host";
49
50
  import { RemoteUiScope } from "../../../../remote/semantic-tree";
@@ -694,6 +695,9 @@ export function ASKGPane({ paneId, focused, width, height }: PaneProps) {
694
695
  : getPaneSidebarWidth(width, !!nativePaneChrome, conversations.width);
695
696
 
696
697
  const running = isTurnRunning(state);
698
+ // The draft lives only as long as the pane does, and an answer coming in
699
+ // would be cut off: Esc never closes the pane over either.
700
+ usePaneUnsentWork(running || inputValue.trim().length > 0, paneId);
697
701
  const confirmation = pendingConfirmation(state);
698
702
  // A tool's approval goes first; the pane's question waits behind it.
699
703
  const paneConsentPending = attached?.consent === "pending" && !confirmation;
@@ -386,6 +386,8 @@ export function ToolResultDetail({
386
386
  rootWidth={width}
387
387
  rootHeight={Math.max(3, height - headerHeight)}
388
388
  columns={columns}
389
+ // A tool's answer, read once: its columns are the tool's, not a layout to keep with the pane.
390
+ columnReorder={false}
389
391
  items={table.rows}
390
392
  sortColumnId={null}
391
393
  sortDirection="asc"
@@ -105,6 +105,7 @@ const askgModule: PluginModule = {
105
105
  component: ASKGPane,
106
106
  defaultPosition: "right",
107
107
  defaultMode: "floating",
108
+ utilityWindow: true,
108
109
  defaultFloatingSize: { width: 96, height: 32 },
109
110
  portableShare: {
110
111
  // A conversation and the panes it read are personal to the account.
@@ -31,6 +31,7 @@ export const teamModule: PluginModule = {
31
31
  component: TeamPane,
32
32
  defaultPosition: "right",
33
33
  defaultMode: "floating",
34
+ utilityWindow: true,
34
35
  defaultFloatingSize: { width: 84, height: 30 },
35
36
  portableShare: {
36
37
  private: { title: true, params: true, settings: true, state: true },
@@ -32,6 +32,7 @@ import {
32
32
  import { promptChoice } from "./prompts";
33
33
  import { thesisStore } from "./store";
34
34
  import { ClippedText } from "../../../../components/ui/display";
35
+ import { useSelectionFill } from "../../../../components/ui/selection-fill";
35
36
  import { logFailure } from "../../../../utils/log-failure";
36
37
 
37
38
  type Row =
@@ -155,6 +156,7 @@ export function ThesisDetail({ thesis, width, height, focused, footerId, onDelet
155
156
  const [busy, setBusy] = useState(false);
156
157
  const generation = useRef(0);
157
158
  const { nativePaneChrome } = useUiCapabilities();
159
+ const selectionFill = useSelectionFill();
158
160
 
159
161
  const ctx = useMemo<flows.FlowContext>(() => ({ dialog, notify, hasProAccess: plan.hasProAccess, openUpgrade }), [dialog, notify, openUpgrade, plan.hasProAccess]);
160
162
 
@@ -355,8 +357,11 @@ export function ThesisDetail({ thesis, width, height, focused, footerId, onDelet
355
357
  const renderRow = useCallback((item: ListViewItem, state: { selected: boolean }) => {
356
358
  const row = rows.find((entry) => entry.id === item.id);
357
359
  if (!row) return null;
358
- const fg = state.selected ? colors.selectedText : colors.text;
359
- const dim = state.selected ? colors.selectedText : colors.textDim;
360
+ const lit = state.selected && selectionFill.lit;
361
+ // On the quieter fill a row's colours are lifted where they would not read.
362
+ const ink = (color: string) => (state.selected ? selectionFill.ink(color) : color);
363
+ const fg = lit ? colors.selectedText : ink(colors.text);
364
+ const dim = lit ? colors.selectedText : ink(colors.textDim);
360
365
  // Every row is a full-width row box, so the DOM host lays headings and
361
366
  // prose out flush left like the pillar rows instead of centering them.
362
367
  if (row.kind === "heading") {
@@ -427,7 +432,7 @@ export function ThesisDetail({ thesis, width, height, focused, footerId, onDelet
427
432
  <Text fg={dim}>{rightText}</Text>
428
433
  </Box>
429
434
  );
430
- }, [contentWidth, rows, thesis.document]);
435
+ }, [contentWidth, rows, selectionFill.lit, thesis.document]);
431
436
 
432
437
  const owner = isTeam ? teamStore.getTeam(thesis.owner.id)?.name ?? "team" : null;
433
438
  const nextDue = thesis.document.catalysts
@@ -519,7 +524,7 @@ export function ThesisDetail({ thesis, width, height, focused, footerId, onDelet
519
524
  rowGap={0}
520
525
  height={nativePaneChrome ? undefined : Math.max(3, height - headerHeight - stripHeight)}
521
526
  flexGrow={nativePaneChrome ? 1 : undefined}
522
- getRowBackgroundColor={(item, state) => (state.selected ? colors.selected : item.disabled ? colors.bg : undefined)}
527
+ getRowBackgroundColor={(item, state) => (state.selected ? selectionFill.bg : item.disabled ? colors.bg : undefined)}
523
528
  remoteRole="thesis"
524
529
  remoteLabel={thesis.title}
525
530
  />
@@ -11,7 +11,7 @@ import {
11
11
  import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
12
12
  import { ageFooterSegment, type PaneFooterSegment } from "../../../components/layout/pane/footer";
13
13
  import { useAsyncResource } from "../../../react/async-resource";
14
- import { useAutoRefresh, useUpdatedAgo } from "../../../react/auto-refresh";
14
+ import { useAutoRefresh, useUpdatedAgo, useUtcDay } from "../../../react/auto-refresh";
15
15
  import { usePaneInstance } from "../../../state/app/context";
16
16
  import { useThemeColors } from "../../../theme/theme-context";
17
17
  import type { PaneProps } from "../../../types/plugin";
@@ -20,6 +20,8 @@ import { withCountryFlag, withFlagRoom } from "../../../components/ui/country-fl
20
20
  import { nextHeaderSort } from "../../../utils/sort-values";
21
21
  import { usePluginPaneState } from "../../runtime";
22
22
  import { fetchCommodityBalances } from "./client";
23
+ import { commodityBalancesHeadless } from "./headless";
24
+ import { reportFooterSegment } from "../shared/source-footer";
23
25
  import {
24
26
  BALANCE_SORT,
25
27
  PRICE_SORT,
@@ -94,11 +96,17 @@ export function CommodityBalancesPane({ width, height, focused }: PaneProps) {
94
96
  queryBarWidth: width,
95
97
  });
96
98
  const updatedAgo = useUpdatedAgo(updatedAt);
99
+ const utcDay = useUtcDay();
100
+ // Its source and the estimates' month, as `fn PSD` ends; how long ago it loaded goes first on a narrow row.
97
101
  const info = useMemo<PaneFooterSegment[]>(() => {
98
- const year = data?.marketYear;
99
- const updated: PaneFooterSegment[] = updatedAgo ? [ageFooterSegment(updatedAgo)] : [];
100
- return year ? [...updated, { id: "year", parts: [{ text: year, tone: "muted" }] }] : updated;
101
- }, [data?.marketYear, updatedAgo]);
102
+ if (!data) return [];
103
+ const year = data.marketYear;
104
+ return [
105
+ reportFooterSegment(commodityBalancesHeadless, { sections: [], ...(data.month ? { metadata: { asOf: `${data.month}-01` } } : {}) }),
106
+ ...(updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
107
+ ...(year ? [{ id: "year", parts: [{ text: year, tone: "muted" as const }] }] : []),
108
+ ];
109
+ }, [data, updatedAgo, utcDay]);
102
110
 
103
111
  useAutoRefresh(updatedAt, load);
104
112
  usePaneRefreshKey(load, { focused });
@@ -282,8 +282,8 @@ export function fitCompanyColumns(columns: readonly DataTableColumn[], width: nu
282
282
  const EXAMPLE_COMPANIES: Record<CompanyMode, readonly string[]> = { guidance: ["WMT", "DAL"], kpis: ["AAPL", "NVDA"] };
283
283
 
284
284
  /**
285
- * What an empty table says. A company with nothing on file for the function says so
286
- * plainly and names one that has some; a selection or tab that narrows what the company
285
+ * What an empty table says. A company with nothing on file for the function reads as
286
+ * not yet available, never as an error, and names one that has some; a selection or tab that narrows what the company
287
287
  * has says what is missing from it. `cli` types `fn GUIDE WMT`, the app's command bar `GUIDE WMT`.
288
288
  */
289
289
  export function companyEmptyState(mode: CompanyMode, symbol: string, view: { tab: string; hasRows: boolean }, surface: "cli" | "pane" = "pane"): { title: string; hint?: string } {
@@ -291,7 +291,7 @@ export function companyEmptyState(mode: CompanyMode, symbol: string, view: { tab
291
291
  const examples = EXAMPLE_COMPANIES[mode];
292
292
  const example = examples.find((candidate) => candidate !== symbol.trim().toUpperCase()) ?? examples[0]!;
293
293
  const command = `${mode === "kpis" ? "KPIS" : "GUIDE"} ${example}`;
294
- return { title: `No ${mode === "kpis" ? "KPIs" : "guidance"} on file for ${symbol}.`, hint: `Try ${surface === "cli" ? `\`fn ${command}\`` : command}.` };
294
+ return { title: mode === "kpis" ? `KPIs for ${symbol} are not yet available.` : `Guidance for ${symbol} is not yet available.`, hint: `Try ${surface === "cli" ? `\`fn ${command}\`` : command}.` };
295
295
  }
296
296
 
297
297
  /** What a missing KPI means, as KPIS states it among its limitations and EQS beside a KPI column with gaps. */
@@ -38,6 +38,7 @@ export const connectionsModule: PluginModule = {
38
38
  reportFreshness: { status: "not-a-feed", basis: "connection health", local: true },
39
39
  defaultPosition: "right",
40
40
  defaultMode: "floating",
41
+ utilityWindow: true,
41
42
  defaultFloatingSize: { width: 80, height: 24 },
42
43
  portableShare: {
43
44
  private: { params: true, settings: true, state: true },
@@ -21,7 +21,9 @@ import type { PaneProps } from "../../../types/plugin";
21
21
  import { usePluginPaneState } from "../../runtime";
22
22
  import { FIXED_INCOME_PANE_ID } from "../fixed-income/model";
23
23
  import { useCommandValue } from "../shared/command-tab";
24
+ import { reportFooterSegment } from "../shared/source-footer";
24
25
  import { getCachedCdxBoard, loadCdxBoard } from "./client";
26
+ import { cdxHeadless } from "./headless";
25
27
  import {
26
28
  axisFormatter,
27
29
  cdxRows,
@@ -30,7 +32,6 @@ import {
30
32
  formatLevel,
31
33
  formatMove,
32
34
  formatSpreadRank,
33
- newestRowDate,
34
35
  partialDayText,
35
36
  SETTLEMENT_TEXT,
36
37
  type CdxRow,
@@ -110,13 +111,16 @@ export function CdxPane({ focused, width, height }: PaneProps) {
110
111
  useAutoRefresh(resource.updatedAt, refresh);
111
112
  usePaneRefreshKey(reload, { focused, enabled: !loading });
112
113
 
113
- // Dated by the newest day the rows carry, not when the response was put together.
114
- const asOf = newestRowDate(payload?.indexes.map((index) => index.date) ?? []);
114
+ // Its source and the newest day the rows carry, not when the response was put together, as `fn CDX` ends.
115
+ // The clock says the prints are delayed, so the line does not again.
116
+ const sourceLine = useMemo(() => payload
117
+ ? reportFooterSegment(cdxHeadless, { sections: [{ title: "", columns: [], rows: payload.indexes.map((index) => ({ date: index.date })) }] }, { feed: false })
118
+ : null, [payload]);
115
119
  // PCTL 1Y ranks spreads; the rows quoted in price (HY, EM) rank their spread equivalent, which a picture keeps.
116
120
  const spreadEqRanked = useMemo(() => rows.filter((row) => row.rank.basis === "spread-eq")
117
121
  .map((row) => row.index.name.replace(/^CDX\s+/i, "")).join(", "), [rows]);
118
122
  const info = useMemo<PaneFooterSegment[]>(() => [
119
- ...(asOf ? [{ id: "as-of", parts: [{ text: `as of ${asOf}`, tone: "muted" as const }] }] : []),
123
+ ...(sourceLine ? [sourceLine] : []),
120
124
  ...(payload ? [DELAYED_SEGMENT] : []),
121
125
  ...(resource.data?.stale ? [{ id: "stale", parts: [{ text: "STALE", tone: "warning" as const }] }] : []),
122
126
  ...(spreadEqRanked ? [{
@@ -124,7 +128,7 @@ export function CdxPane({ focused, width, height }: PaneProps) {
124
128
  parts: [{ text: `${spreadEqRanked} pctl on spread eq`, tone: "muted" as const }],
125
129
  variants: [[{ text: "pctl on spread eq", tone: "muted" as const }]],
126
130
  }] : []),
127
- ], [asOf, payload, resource.data?.stale, spreadEqRanked]);
131
+ ], [payload, sourceLine, resource.data?.stale, spreadEqRanked]);
128
132
  usePaneStatusFooter({
129
133
  registrationId: "cdx",
130
134
  loading,
@@ -63,6 +63,11 @@ type BoardClient = Pick<typeof apiClient, "getCloudCdxBoard" | "getCloudSovrBoar
63
63
  /** Days of history the server serves at most, for a history export. */
64
64
  export const CDX_MAX_DAYS = 1100;
65
65
 
66
+ /** The publisher a board's payload names, spelled out: `DTCC PPD` is DTCC's public price dissemination. */
67
+ export function boardPublisher(source: string | null | undefined): string | undefined {
68
+ return source?.trim().replace(/\bPPD\b/, "Public Price Dissemination") || undefined;
69
+ }
70
+
66
71
  export async function fetchCdxBoard(client: BoardClient = apiClient, days = BOARD_DAYS): Promise<CdxBoardPayload> {
67
72
  try { return validateCdxBoard(await client.getCloudCdxBoard({ days })); }
68
73
  catch (error) { throw unavailableOnServer(error, "Index CDS levels are not available yet."); }
@@ -1,6 +1,6 @@
1
1
  import type { HeadlessPaneColumn, HeadlessPaneDefinition, HeadlessPaneRow } from "../../../types/plugin";
2
2
  import type { CdxBoardIndex, CreditIndexQuote } from "../../../api-client/credit-boards";
3
- import { CDX_MAX_DAYS, fetchCdxBoard, fetchSovrBoard, loadCurrencyMoves } from "./client";
3
+ import { boardPublisher, CDX_MAX_DAYS, fetchCdxBoard, fetchSovrBoard, loadCurrencyMoves } from "./client";
4
4
  import { readsInBatches } from "../../../market-data/batched-reads";
5
5
  import {
6
6
  cdxDay,
@@ -55,11 +55,6 @@ const dayColumn: HeadlessPaneColumn = {
55
55
  format: (value) => typeof value === "string" ? value : "",
56
56
  };
57
57
 
58
- /** The publisher a board's payload names, spelled out: `DTCC PPD` is DTCC's public price dissemination. */
59
- function boardPublisher(source: string | null | undefined): string | undefined {
60
- return source?.trim().replace(/\bPPD\b/, "Public Price Dissemination") || undefined;
61
- }
62
-
63
58
  /**
64
59
  * Each day's level on the contract on the run that day, newest first, over
65
60
  * the last `days`: the chart as a table. Its key is `day`, not `date`, so the
@@ -224,12 +224,6 @@ export function formatSpreadRank(rank: SpreadRank): string {
224
224
  return rank.basis === "price-inverted" && rank.percentile != null ? `${text}, price inverted` : text;
225
225
  }
226
226
 
227
- /** The newest day a board's rows are dated, which its footer dates the board by; null with none. */
228
- export function newestRowDate(dates: ReadonlyArray<string | null | undefined>): string | null {
229
- return dates.reduce<string | null>((newest, date) => date && /^\d{4}-\d{2}-\d{2}/.test(date) && (!newest || date > newest)
230
- ? date.slice(0, 10) : newest, null);
231
- }
232
-
233
227
  function daysBetween(from: string, to: string): number {
234
228
  return Math.round((Date.parse(to) - Date.parse(from)) / 86_400_000);
235
229
  }