@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
@@ -101,9 +101,10 @@ import {
101
101
  } from "./model";
102
102
  import { findNamedCollection, readWatchlistArgument } from "../../../portfolio/collection-name";
103
103
  import { useScreenResults } from "./results";
104
+ import { useRefreshAnchor } from "./refresh-anchor";
104
105
  import { screenWatchlistList } from "./watchlist";
105
106
  import { unmatchedCategoryText, unmatchedCategoryValues } from "./categories";
106
- import { overlayLiveScreenRows, screenExtendedMove, screenExtendedSessions, sortLiveScreenRows, type LiveScreenRow } from "./live";
107
+ import { liveScreenPlaces, overlayLiveScreenRows, placeLiveScreenRows, screenExtendedMove, screenExtendedSessions, type LiveScreenRow } from "./live";
107
108
  import { useLiveQuoteEntries } from "../../../state/hooks/quote-streaming";
108
109
  import { buildScreenerQuoteTargets } from "../../../market-data/quotes/screener-live-quotes";
109
110
  import { useLiveStreamingSetting } from "../../../state/hooks/live-streaming";
@@ -380,20 +381,16 @@ function EquityScreenView({
380
381
  LIVE_ORDER_SAMPLE_MS,
381
382
  `${data?.snapshot?.id ?? ""}:${JSON.stringify(definition.sort)}:${snapshotRows.length}`,
382
383
  );
383
- const rows = useMemo(() => {
384
- const order = new Map(sortLiveScreenRows(orderRows, definition.sort).map((row, index) => [screenRowId(row), index]));
385
- return liveRows
386
- .map((row, index) => ({ row, index, place: order.get(screenRowId(row)) ?? Number.POSITIVE_INFINITY }))
387
- .sort((a, b) => a.place - b.place || a.index - b.index)
388
- .map(({ row }) => row);
389
- }, [definition.sort, liveRows, orderRows]);
390
- const opened = rows.find((row) => screenRowId(row) === openId);
384
+ const places = useMemo(() => liveScreenPlaces(orderRows, definition.sort), [definition.sort, orderRows]);
385
+ const rows = useMemo(() => placeLiveScreenRows(liveRows, places), [liveRows, places]);
386
+ const { anchor: refreshAnchor, release: releaseRefreshAnchor } = useRefreshAnchor(data?.snapshot?.id ?? null, rows, visibleRange.start);
387
+ const opened = openId ? rows.find((row) => screenRowId(row) === openId) : undefined;
391
388
  const selected =
392
389
  opened ?? rows.find((row) => screenRowId(row) === selectedId) ?? rows[0];
393
390
  const currentSaved = saved.data?.find((row) => row.id === currentSavedId);
394
391
  // The pane menu's Save to Watchlist… takes the matches loaded, in the order shown (the first page is 100). A live
395
392
  // quote changes the rows but not who they are, so the menu is rebuilt only when the order does.
396
- const shownOrder = rows.map(screenRowId).join(" ");
393
+ const shownOrder = useMemo(() => [...places.keys()].join(" "), [places]);
397
394
  const watchlistList = useMemo(
398
395
  () => mode === "results" && !openId && data && screenDefinitionKey(data.definition) === screenDefinitionKey(definition)
399
396
  ? screenWatchlistList({ definition, rows, matched: data.universe.matched, savedName: currentSaved?.name })
@@ -443,22 +440,27 @@ function EquityScreenView({
443
440
  ]);
444
441
  const tableScroll = useRef<ScrollBoxRenderable>(null);
445
442
  const queryControl = useRef<SelectControl>(null);
446
- const loadMore = useTableLoadMore(
443
+ const loadMoreNearEnd = useTableLoadMore(
447
444
  tableScroll,
448
445
  !opened && !results.loading && !results.loadingMore && !!data?.nextCursor,
449
446
  results.loadMore,
450
447
  );
448
+ const loadMore = useCallback((source?: "programmatic" | "user") => {
449
+ if (source === "user") releaseRefreshAnchor();
450
+ loadMoreNearEnd();
451
+ }, [loadMoreNearEnd, releaseRefreshAnchor]);
451
452
  const metricFields = pickerFields(
452
453
  fields.data?.fields.filter((field) => field.kind === "number") ?? [],
453
454
  [metric],
454
455
  );
455
456
  // AS OF earns its column only when some row's focus metric is stale; the
456
457
  // snapshot decides, so a live quote freshening a row does not reflow the table.
457
- const staleFocus = snapshotRows.some((row) => row.metrics[metric]?.state === "stale");
458
+ const staleFocus = useMemo(() => snapshotRows.some((row) => row.metrics[metric]?.state === "stale"), [metric, snapshotRows]);
458
459
  // A pre-market, after-hours or overnight column only while a row has such a print.
459
- const extendedSessions = screenExtendedSessions(rows);
460
+ const extendedSessions = useMemo(() => screenExtendedSessions(rows), [rows]);
460
461
  // YTD names the close it is measured from, `31 Dec`.
461
- const ytdBase = screenYtdBase(snapshotRows, data?.snapshot?.assembledAt);
462
+ const assembledAt = data?.snapshot?.assembledAt;
463
+ const ytdBase = useMemo(() => screenYtdBase(snapshotRows, assembledAt), [assembledAt, snapshotRows]);
462
464
  // A screen its currency emptied says so, not that no company matches.
463
465
  const currencyEmpty = data && data.rows.length === 0 ? screenCurrencyEmpty(data.definition, data.universe) : null;
464
466
  // A criterion's name that matches nothing (`Utility`) says so with the names it was likely meant as.
@@ -1082,6 +1084,9 @@ function EquityScreenView({
1082
1084
  rootHeight={bodyHeight - 1}
1083
1085
  scrollRef={tableScroll}
1084
1086
  onBodyScrollActivity={loadMore}
1087
+ scrollToIndex={refreshAnchor?.index}
1088
+ scrollToIndexAlign={refreshAnchor ? "start" : "nearest"}
1089
+ scrollToIndexVersion={refreshAnchor?.version ?? 0}
1085
1090
  resetScrollKey={JSON.stringify(definition)}
1086
1091
  visibleRangeKey={JSON.stringify(definition)}
1087
1092
  onVisibleRangeChange={setVisibleRange}
@@ -0,0 +1,45 @@
1
+ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
2
+ import type { ScreenRow } from "../../../api-client/equity-screener";
3
+ import { screenRowId } from "./model";
4
+
5
+ /** How long a refresh keeps asking the table to hold the row that was at its top. */
6
+ const REFRESH_ANCHOR_HOLD_MS = 2_000;
7
+
8
+ export interface RefreshAnchor {
9
+ index: number;
10
+ version: number;
11
+ }
12
+
13
+ /**
14
+ * A refresh puts a new snapshot's rows under the scroll position. This asks
15
+ * the table to keep the row that sat at its top there: the anchor is the
16
+ * row's place in the new rows, as a `scrollToIndex` request with a new
17
+ * `version` per refresh. A list at its top stays there, and a row the new
18
+ * snapshot dropped leaves the scroll as it is. The request lapses once the
19
+ * user scrolls (`release`), and a moment after, when the table has long since
20
+ * applied it.
21
+ */
22
+ export function useRefreshAnchor(
23
+ snapshotId: string | null,
24
+ rows: readonly ScreenRow[],
25
+ firstVisible: number,
26
+ ): { anchor: RefreshAnchor | null; release: () => void } {
27
+ const topRow = rows[firstVisible];
28
+ const topRowId = topRow ? screenRowId(topRow) : null;
29
+ const kept = useRef({ snapshotId, topRowId, firstVisible });
30
+ const [anchor, setAnchor] = useState<RefreshAnchor | null>(null);
31
+ useLayoutEffect(() => {
32
+ const before = kept.current;
33
+ kept.current = { snapshotId, topRowId, firstVisible };
34
+ if (!before.topRowId || !before.snapshotId || !snapshotId || before.snapshotId === snapshotId || before.firstVisible === 0) return;
35
+ const index = rows.findIndex((row) => screenRowId(row) === before.topRowId);
36
+ if (index >= 0 && index !== before.firstVisible) setAnchor((current) => ({ index, version: (current?.version ?? 0) + 1 }));
37
+ });
38
+ useEffect(() => {
39
+ if (!anchor) return;
40
+ const timer = setTimeout(() => setAnchor(null), REFRESH_ANCHOR_HOLD_MS);
41
+ return () => clearTimeout(timer);
42
+ }, [anchor]);
43
+ const release = useCallback(() => setAnchor(null), []);
44
+ return { anchor, release };
45
+ }
@@ -8,7 +8,16 @@ import { logFailure } from "../../../utils/log-failure";
8
8
  import { fetchScreen } from "./client";
9
9
  import { appendScreenPage } from "./model";
10
10
 
11
- /** Query changes and pagination cannot exchange data across immutable snapshots. */
11
+ /** A refresh re-reads what a long list holds, up to this many rows, so it does not walk an endless one. */
12
+ const REFRESH_ROW_LIMIT = 1_000;
13
+
14
+ /**
15
+ * Query changes and pagination cannot exchange data across immutable snapshots.
16
+ * A refresh of a screen already loaded replaces its rows in place: the first
17
+ * page of the new snapshot, then as many more as the list held, swapped in
18
+ * together so the table keeps its length and its scroll position. A refresh
19
+ * that finds the same snapshot keeps the pages as they are.
20
+ */
12
21
  export function useScreenResults(
13
22
  definition: ScreenDefinition,
14
23
  sessionKey: string,
@@ -42,6 +51,7 @@ export function useScreenResults(
42
51
  moreController.current = null;
43
52
  const request = new AbortController();
44
53
  controller.current = request;
54
+ const held = stateRef.current.identity === identity ? stateRef.current.data : null;
45
55
  setState((current) => ({
46
56
  identity,
47
57
  data: current.identity === identity ? current.data : null,
@@ -51,8 +61,18 @@ export function useScreenResults(
51
61
  updatedAt: current.identity === identity ? current.updatedAt : null,
52
62
  }));
53
63
  try {
54
- const data = await fetcher(definition, null, request.signal);
64
+ let data = await fetcher(definition, null, request.signal);
55
65
  if (request.signal.aborted || activeIdentity.current !== identity) return;
66
+ if (held?.snapshot && data.snapshot?.id === held.snapshot.id) {
67
+ data = held;
68
+ } else if (held) {
69
+ const wanted = Math.min(held.rows.length, REFRESH_ROW_LIMIT);
70
+ while (data.nextCursor && data.rows.length < wanted) {
71
+ const page = await fetcher(definition, data.nextCursor, request.signal);
72
+ if (request.signal.aborted || activeIdentity.current !== identity) return;
73
+ data = appendScreenPage(data, page);
74
+ }
75
+ }
56
76
  setState({
57
77
  identity,
58
78
  data,
@@ -1,10 +1,16 @@
1
1
  import type { NumericField, ScreenCheckPayload, ScreenCriterion, ScreenDefinition } from "../../../api-client/equity-screener";
2
- import { canonicalExchange, parsePublicTickerKey } from "../../../utils/exchanges";
2
+ import { parseListingArg } from "../../../cli/listing-arg";
3
+ import { canonicalExchange } from "../../../utils/exchanges";
3
4
  import { criterionText, formatScreenValue, GRADE_DISPLAY_FIELDS, parseScreenDefinition, screenDefinitionKey, screenLabel } from "./model";
4
5
 
5
- /** One listing, with the same exchange aliases the rest of the app accepts. */
6
+ /**
7
+ * One listing, read as `quote` reads it before it asks: 700:HKEX, 700.HK and
8
+ * 00700.HK are 0700:HKEX, GARAN.IS is GARAN:BIST, "VOD LN" VOD:LSE. A bare
9
+ * symbol stays bare, for the screen to pick its listing.
10
+ */
6
11
  export function screenCheckTicker(text: string): { symbol: string; exchange?: string } {
7
- const ticker = parsePublicTickerKey(text.trim());
12
+ const listing = parseListingArg(text.trim(), null, { listingSuffix: true });
13
+ const ticker = listing.exchange ? { symbol: listing.symbol, exchange: listing.exchange } : { symbol: listing.symbol };
8
14
  if (!/^[A-Z0-9][A-Z0-9./-]{0,31}$/.test(ticker.symbol)
9
15
  || (ticker.exchange !== undefined && !/^[A-Z0-9_-]{1,24}$/.test(ticker.exchange)))
10
16
  throw new Error("Enter one ticker, such as NVDA or NVDA:NASDAQ.");
@@ -54,6 +54,21 @@ function projectFearGreedHeadless(data: FearGreedData): HeadlessBundleResult {
54
54
  };
55
55
  }
56
56
 
57
+ /** `fn FNG` over a loaded reading, which the pane's footer also reads its source line from. */
58
+ export function fearGreedReport(result: FearGreedLoadResult): HeadlessBundleResult {
59
+ // A copy kept for a refresh that could not get through (offline, a timeout) ends the report with when it was
60
+ // saved, as other reports do; any other failure stays an error beside the old reading.
61
+ const savedCopy = result.source === "stale-fallback" && isTransientFailure(result.error);
62
+ const metadata = { fetchedAt: result.fetchedAt, stale: result.stale };
63
+ return {
64
+ ...projectFearGreedHeadless(result.data),
65
+ ...(result.refreshError && !savedCopy ? { errors: [result.refreshError] } : {}),
66
+ // A cached index the refresh could not replace is stale; otherwise CNN's published reading.
67
+ freshness: { source: "CNN", status: result.stale ? "stale" : "not-a-feed", basis: "published index" },
68
+ metadata: savedCopy ? servedFromSavedCopy(metadata, result.fetchedAt) : metadata,
69
+ };
70
+ }
71
+
57
72
  export interface FearGreedHeadlessDependencies {
58
73
  load(args: HeadlessPaneLoadArgs, signal: AbortSignal): Promise<FearGreedLoadResult>;
59
74
  }
@@ -73,19 +88,7 @@ export function createFearGreedHeadless(
73
88
  options: [],
74
89
  describe: "Fear & Greed",
75
90
  async load(args, ctx) {
76
- const result = await dependencies.load(args, ctx.signal);
77
- const projected = projectFearGreedHeadless(result.data);
78
- // A copy kept for a refresh that could not get through (offline, a timeout) ends the report with when it was
79
- // saved, as other reports do; any other failure stays an error beside the old reading.
80
- const savedCopy = result.source === "stale-fallback" && isTransientFailure(result.error);
81
- const metadata = { fetchedAt: result.fetchedAt, stale: result.stale };
82
- return {
83
- ...projected,
84
- ...(result.refreshError && !savedCopy ? { errors: [result.refreshError] } : {}),
85
- // A cached index the refresh could not replace is stale; otherwise CNN's published reading.
86
- freshness: { source: "CNN", status: result.stale ? "stale" : "not-a-feed", basis: "published index" },
87
- metadata: savedCopy ? servedFromSavedCopy(metadata, result.fetchedAt) : metadata,
88
- };
91
+ return fearGreedReport(await dependencies.load(args, ctx.signal));
89
92
  },
90
93
  };
91
94
  }
@@ -14,7 +14,9 @@ import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
14
14
  import { useAsyncResource } from "../../../react/async-resource";
15
15
  import type { PaneProps } from "../../../types/plugin";
16
16
  import { Box, ScrollBox, useUiHost } from "../../../ui";
17
- import { useAutoRefresh, useUpdatedAgo } from "../../../react/auto-refresh";
17
+ import { useAutoRefresh, useUpdatedAgo, useUtcDay } from "../../../react/auto-refresh";
18
+ import { reportFooterSegment } from "../shared/source-footer";
19
+ import { fearGreedHeadless, fearGreedReport } from "./headless";
18
20
  import { getCachedFearGreedData, loadFearGreed, type FearGreedLoadResult } from "./cache";
19
21
  import { IndexHistoryChart, IndicatorChart } from "./charts";
20
22
  import type { FearGreedData } from "./data";
@@ -57,6 +59,8 @@ export function FearGreedPane({ paneId, focused, width, height }: PaneProps) {
57
59
 
58
60
  usePaneRefreshKey(refresh, { focused });
59
61
 
62
+ const utcDay = useUtcDay();
63
+ const loaded = resource.data;
60
64
  const footerInfo = useMemo(() => [
61
65
  ...(data ? [{
62
66
  id: "score",
@@ -64,10 +68,14 @@ export function FearGreedPane({ paneId, focused, width, height }: PaneProps) {
64
68
  { text: `${formatScore(data.overall.score)} ${ratingLabel(data.overall.rating)}`, color: ratingColor(data.overall.rating), bold: true },
65
69
  ],
66
70
  }] : []),
67
- ...(savedAt != null ? [savedCopyFooterSegment("saved-copy", savedAt)]
68
- : stale ? [{ id: "stale", parts: [{ text: "stale", tone: "warning" as const }] }] : []),
71
+ // Its source and when CNN published the reading, as `fn FNG` ends, a stale one with its warning beside it;
72
+ // a saved copy says when it was saved instead.
73
+ ...(savedAt != null ? [savedCopyFooterSegment("saved-copy", savedAt)] : [
74
+ ...(loaded?.data ? [reportFooterSegment(fearGreedHeadless, fearGreedReport({ ...loaded, stale: false }))] : []),
75
+ ...(stale ? [{ id: "stale", parts: [{ text: "stale", tone: "warning" as const }] }] : []),
76
+ ]),
69
77
  ...(updatedAgo ? [ageFooterSegment(updatedAgo, { id: "age", verb: "updated", tone: "value" })] : []),
70
- ], [data, savedAt, stale, updatedAgo]);
78
+ ], [data, loaded, savedAt, stale, updatedAgo, utcDay]);
71
79
  usePaneStatusFooter({ registrationId: paneId, loading, error, info: footerInfo });
72
80
 
73
81
  const previousScores = useMemo(() => (data ? previousScoreItems(data) : []), [data]);
@@ -37,6 +37,7 @@ export const filingEventsModule: PluginModule = {
37
37
  component: FilingEventsPane,
38
38
  instruments: ["equity"],
39
39
  isVisible: ({ ticker }) => !isKnownNonUsListing(ticker),
40
+ proOnly: true,
40
41
  });
41
42
  },
42
43
 
@@ -15,7 +15,7 @@ import {
15
15
  import { handleRefreshKey } from "../../../components/data-table/table-pane";
16
16
  import { useRemoteUiNode } from "../../../remote/semantic-tree";
17
17
  import { usePaneVisible } from "../../../state/app/activity";
18
- import { usePaneInstance, usePaneSettingValue } from "../../../state/app/context";
18
+ import { useOptionalPaneSettingUpdater, usePaneInstance, usePaneSettingValue } from "../../../state/app/context";
19
19
  import { TICKER_RESEARCH_PANE_ID } from "../../../types/config";
20
20
  import type { PaneProps } from "../../../types/plugin";
21
21
  import { isPlainKey } from "../../../utils/keyboard";
@@ -60,6 +60,7 @@ import {
60
60
  } from "./model";
61
61
  import {
62
62
  createFuturesColumns,
63
+ DEFAULT_FUTURES_COLUMN_IDS,
63
64
  FUTURES_COLUMN_DEFS,
64
65
  FUTURES_REPORT_COLUMNS,
65
66
  renderFuturesCell,
@@ -88,6 +89,7 @@ export function FuturesPane({ focused, width, height }: PaneProps) {
88
89
  const { pinTicker } = usePluginTickerActions();
89
90
  const dataProvider = useAssetData();
90
91
  const paneInstance = usePaneInstance();
92
+ const updateColumnIds = useOptionalPaneSettingUpdater(paneInstance?.instanceId ?? null, "columnIds");
91
93
  const liveStreaming = useLiveStreamingSetting();
92
94
  const [selectedId, setSelectedId] = useState<string | null>(null);
93
95
  const [sortPreference, setSortPreference] = useState<FuturesSortPreference>(DEFAULT_FUTURES_SORT);
@@ -154,6 +156,17 @@ export function FuturesPane({ focused, width, height }: PaneProps) {
154
156
  })), [columns, returns]);
155
157
  const titledColumns = useMemo(() => returnBases.size === 0 ? columns
156
158
  : columns.map((column) => returnBases.has(column.id) ? { ...column, title: returnBases.get(column.id) } : column), [columns, returnBases]);
159
+ // A header dragged to a new place rewrites the Columns setting; back in the default order, the setting goes, so
160
+ // columns later added to the defaults still show. The session mark and the symbol name the row and stay first.
161
+ const anchoredColumns = columns.findIndex((column) => column.id !== "status" && column.id !== "code");
162
+ const columnReorder = useMemo(() => ({
163
+ anchored: anchoredColumns > 0 ? anchoredColumns : undefined,
164
+ control: {
165
+ order: visibleColumnIds,
166
+ defaultOrder: DEFAULT_FUTURES_COLUMN_IDS,
167
+ onChange: (ids: string[] | undefined) => updateColumnIds(() => ids),
168
+ },
169
+ }), [anchoredColumns, updateColumnIds, visibleColumnIds]);
157
170
  useRemoteUiNode(returnBases.size > 0 ? {
158
171
  role: "report-notice",
159
172
  label: "Return base dates",
@@ -369,6 +382,7 @@ export function FuturesPane({ focused, width, height }: PaneProps) {
369
382
  rootWidth={width}
370
383
  rootHeight={height}
371
384
  columns={titledColumns}
385
+ columnReorder={columnReorder}
372
386
  items={dataProvider ? rows : []}
373
387
  sortable
374
388
  sortColumnId={sortPreference.columnId}
@@ -37,7 +37,7 @@ export const FUTURES_COLUMN_DEFS: readonly FuturesColumnDef[] = [
37
37
  { id: "time", label: "Time", description: "UTC time of the last quote." },
38
38
  ];
39
39
 
40
- const DEFAULT_FUTURES_COLUMN_IDS = FUTURES_COLUMN_DEFS.map((column) => column.id);
40
+ export const DEFAULT_FUTURES_COLUMN_IDS = FUTURES_COLUMN_DEFS.map((column) => column.id);
41
41
 
42
42
  /**
43
43
  * Extra columns only earn their width once the board is wide enough to keep a
@@ -20,7 +20,7 @@ import { useFxRatesMap } from "../../../market-data/hooks";
20
20
  import { resolveEntryData } from "../../../market-data/selectors";
21
21
  import { useRemoteUiNode } from "../../../remote/semantic-tree";
22
22
  import { usePaneSettingValue, useUpdatePaneSettings } from "../../../state/app/context";
23
- import { colors, shownPriceColor } from "../../../theme/colors";
23
+ import { colors, inactiveSelectedBg, shownPriceColor } from "../../../theme/colors";
24
24
  import { formatPercentRaw, MISSING_VALUE } from "../../../utils/format";
25
25
  import type {
26
26
  CommandBarResultDef, CommandBarSearchProvider, GloomPluginContext, PaneProps, PaneTemplateContext, PaneTemplateCreateOptions,
@@ -33,7 +33,8 @@ import { summarizeFxRates, fxStatusLabel } from "../../../utils/fx-status";
33
33
  import type { PluginModule } from "../plugin-module";
34
34
  import { fxRateObservations } from "../shared/fx-rate-freshness";
35
35
  import { useLiveQuoteEntries } from "../../../state/hooks/quote-streaming";
36
- import { useAutoRefresh, useUpdatedAgo } from "../../../react/auto-refresh";
36
+ import { useAutoRefresh, useUpdatedAgo, useUtcDay } from "../../../react/auto-refresh";
37
+ import { reportFooterSegment } from "../shared/source-footer";
37
38
  import { useLiveStreamingSetting } from "../../../state/hooks/live-streaming";
38
39
  import { fxBoardMoveDay, fxLegMoveReference, fxLegQuoteKey, fxLegReferenceRate, fxLegSavedAt, fxLegTargets, fxLegs, fxLegsBehind, liveFxLegEntry } from "./live-legs";
39
40
  import { CURRENCY_FLAG_REGIONS, FX_CURRENCIES, formatRate, resolveCurrencies, type FxCurrency } from "./pairs";
@@ -195,20 +196,19 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
195
196
  }));
196
197
  // A report or capture of the board is dated by the rates it draws: when each
197
198
  // was observed, whether it is delayed or stale, and where the FX market
198
- // stands. The pane draws none of this; its footer keeps its own status.
199
+ // stands. The footer ends with the same line, as `fn FXC` does.
200
+ const rateObservations = () => {
201
+ const legQuotes = new Map(legs.map((leg) => [leg.currency, resolveEntryData(legEntries.get(fxLegQuoteKey(leg)))] as const));
202
+ return fxRateObservations(currencies, rates, (currency) => ({
203
+ entry: rateEntries.get(currency),
204
+ // Only a rate that is the pair quote's own says what that quote says.
205
+ legQuote: liveEntries.has(currency) ? legQuotes.get(currency) : null,
206
+ }));
207
+ };
199
208
  useRemoteUiNode({
200
209
  role: "report-freshness",
201
210
  label: "Rate freshness",
202
- getMetadata: () => {
203
- const legQuotes = new Map(legs.map((leg) => [leg.currency, resolveEntryData(legEntries.get(fxLegQuoteKey(leg)))] as const));
204
- return {
205
- observations: fxRateObservations(currencies, rates, (currency) => ({
206
- entry: rateEntries.get(currency),
207
- // Only a rate that is the pair quote's own says what that quote says.
208
- legQuote: liveEntries.has(currency) ? legQuotes.get(currency) : null,
209
- })),
210
- };
211
- },
211
+ getMetadata: () => ({ observations: rateObservations() }),
212
212
  });
213
213
  const status = summarizeFxRates(currencies, rates, (currency) => rateEntries.get(currency));
214
214
  const statusText = fxStatusLabel(status);
@@ -300,7 +300,7 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
300
300
  row: FxCurrency,
301
301
  column: DataTableColumn,
302
302
  _index: number,
303
- rowState: { selected: boolean },
303
+ rowState: { selected: boolean; inactive?: boolean },
304
304
  ): DataTableCell => {
305
305
  if (column.id === "base") {
306
306
  return {
@@ -344,9 +344,12 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
344
344
  ? crossMovePercent(base, rowReference, quote, columnReference)
345
345
  : null,
346
346
  );
347
- // The cursor row keeps its selection colours; the tint leans on them.
347
+ // The cursor row keeps its selection colours, quieter while the board does
348
+ // not have the keys; the tint leans on them.
348
349
  const backgroundColor = rowState.selected
349
- ? directionTint(level, { background: colors.selected, text: colors.selectedText })
350
+ ? rowState.inactive
351
+ ? directionTint(level, { background: inactiveSelectedBg(colors), text: colors.text })
352
+ : directionTint(level, { background: colors.selected, text: colors.selectedText })
350
353
  : directionTint(level, { background: colors.bg, text: colors.text });
351
354
  return { text: formatRate(base / quote, quoteCurrency, reference), color: colors.text, backgroundColor };
352
355
  }, [amount?.currency, convertedAmount, directionReferences, flagged, moveVsUsd, rates, referenceRates, status.loading]);
@@ -354,6 +357,7 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
354
357
  const handleKeyDown = useCallback((event: DataTableKeyEvent) => handleRefreshKey(event, refresh), [refresh]);
355
358
 
356
359
  const updatedAgo = useUpdatedAgo(status.latestFetchedAt || null);
360
+ const utcDay = useUtcDay();
357
361
 
358
362
  usePaneFooter(FX_MATRIX_PANE_ID, () => {
359
363
  const info: PaneFooterSegment[] = [];
@@ -361,13 +365,20 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
361
365
  const unreadAmount = amountError ?? (typedAmount && "error" in typedAmount ? typedAmount.error : null);
362
366
  if (unreadAmount) info.push({ id: "amount", parts: [{ text: unreadAmount, tone: "warning" }] });
363
367
  if (status.loading > 0) info.push({ id: "loading", parts: [{ text: "loading", tone: "muted" }] });
364
- if (statusText) info.push({ id: "rates", parts: [{ text: statusText, tone: status.stale || status.unknownTime || status.unavailable ? "warning" : "muted" }] });
368
+ // Where the rates are from and when, as `fn FXC` ends, dates them: the rates' status then says only what is wrong,
369
+ // naming the pair, never the oldest rate's time again.
370
+ const observations = savedAt == null ? rateObservations() : [];
371
+ const warns = !!(status.stale || status.unknownTime || status.unavailable);
372
+ if (statusText && (warns || observations.length === 0)) info.push({ id: "rates", parts: [{ text: statusText, tone: warns ? "warning" : "muted" }] });
365
373
  // Every cross is read through each currency's dollar pair, the amount column too; `fx` reads a pair's own quote.
366
374
  info.push({ id: "cross", parts: [{ text: "via USD", tone: "muted" }] });
367
375
  if (savedAt != null) info.push(savedCopyFooterSegment("updated", savedAt));
368
- else if (updatedAgo) info.push(ageFooterSegment(updatedAgo, { verb: "fetched" }));
376
+ else {
377
+ if (observations.length) info.push(reportFooterSegment(fxMatrixHeadless, { rows: [], freshness: { observations } }));
378
+ if (updatedAgo) info.push(ageFooterSegment(updatedAgo, { verb: "fetched" }));
379
+ }
369
380
  return { info };
370
- }, [amountError, savedAt, status.loading, statusText, typedAmount, updatedAgo]);
381
+ }, [amountError, rates, savedAt, status.loading, status.stale, status.unavailable, status.unknownTime, statusText, typedAmount, updatedAgo, utcDay]);
371
382
 
372
383
  const queryBar = (
373
384
  <QueryBar
@@ -405,6 +416,8 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
405
416
  resetScrollKey={amount ? storedFxBoardAmount(amount) : ""}
406
417
  // A pane too narrow for every currency scrolls to the rest, as other wide tables do; the row's code stays.
407
418
  columns={allColumns}
419
+ // Each column is a row's currency in the same order: the matrix reads across and down alike.
420
+ columnReorder={false}
408
421
  freezeFirstColumn
409
422
  getExportMetadata={() => createFxExportMetadata(currencies, rates,
410
423
  (currency) => rateEntries.get(currency))}
@@ -19,7 +19,7 @@ import { useAsyncResource } from "../../../react/async-resource";
19
19
  import { useShortcut } from "../../../react/input";
20
20
  import { colors, priceColor } from "../../../theme/colors";
21
21
  import type { HolderData } from "../../../types/financials";
22
- import { clipToDisplayWidth, formatCompact } from "../../../utils/format";
22
+ import { clipToDisplayWidth, displayWidth, formatCompact } from "../../../utils/format";
23
23
  import { isPlainKey } from "../../../utils/keyboard";
24
24
  import { nextHeaderSort } from "../../../utils/sort-values";
25
25
  import { useAssetData, usePluginAppActions, usePluginPaneState } from "../../runtime";
@@ -66,6 +66,34 @@ function cikMatches(rows: readonly HolderRow[]): Map<string, Holder13FMatch> {
66
66
  /** The width of a three-letter badge ("13F", "ADR"): the label and its padding. */
67
67
  const BADGE_WIDTH = 5;
68
68
 
69
+ /**
70
+ * A holder's name and its markers. ADR: a position held as receipts on a home line's list. 13F: a fund
71
+ * whose filing opens on Enter or o. The name gives way first, so the markers survive a narrow column;
72
+ * the cell says how wide it draws whole (`contentWidth`), so the table fits the column to it.
73
+ */
74
+ export function holderNameCell(
75
+ name: string,
76
+ { receipts, fund }: { receipts: string; fund: boolean },
77
+ color: string,
78
+ width: number,
79
+ ): DataTableCell {
80
+ if (!receipts && !fund) return { text: name, color, attributes: TextAttributes.BOLD };
81
+ const badges = (receipts ? 1 : 0) + (fund ? 1 : 0);
82
+ return {
83
+ text: [name, receipts, fund ? "13F" : ""].filter(Boolean).join(" "),
84
+ contentWidth: displayWidth(name) + badges * (BADGE_WIDTH + 1),
85
+ content: (
86
+ <Box flexDirection="row" gap={1} width={width} overflow="hidden">
87
+ <Text fg={color} attributes={TextAttributes.BOLD}>
88
+ {clipToDisplayWidth(name, Math.max(1, width - badges * (BADGE_WIDTH + 1)))}
89
+ </Text>
90
+ {receipts ? <Badge label={receipts} /> : null}
91
+ {fund ? <Badge label="13F" tone="accent" /> : null}
92
+ </Box>
93
+ ),
94
+ };
95
+ }
96
+
69
97
  export function HoldersView({ focused, width, height }: { focused: boolean; width: number; height: number }) {
70
98
  const { nativePaneChrome } = useUiCapabilities();
71
99
  const { symbol, ticker, financials } = usePaneTicker();
@@ -286,25 +314,7 @@ export function HoldersView({ focused, width, height }: { focused: boolean; widt
286
314
  switch (column.id) {
287
315
  case "holder": {
288
316
  const color = rowState.selected ? colors.selectedText : colors.textBright;
289
- // ADR: a position held as receipts on a home line's list. 13F: a fund
290
- // whose filing opens on Enter or o.
291
- const receipts = holderShareBasisMarker(row);
292
- const fund = fundMatches.has(row.id);
293
- if (!receipts && !fund) return { text: row.name, color, attributes: TextAttributes.BOLD };
294
- const badges = (receipts ? 1 : 0) + (fund ? 1 : 0);
295
- // The name gives way first, so the markers survive a narrow column.
296
- return {
297
- text: [row.name, receipts, fund ? "13F" : ""].filter(Boolean).join(" "),
298
- content: (
299
- <Box flexDirection="row" gap={1} width={column.width} overflow="hidden">
300
- <Text fg={color} attributes={TextAttributes.BOLD}>
301
- {clipToDisplayWidth(row.name, Math.max(1, column.width - badges * (BADGE_WIDTH + 1)))}
302
- </Text>
303
- {receipts ? <Badge label={receipts} /> : null}
304
- {fund ? <Badge label="13F" tone="accent" /> : null}
305
- </Box>
306
- ),
307
- };
317
+ return holderNameCell(row.name, { receipts: holderShareBasisMarker(row), fund: fundMatches.has(row.id) }, color, column.width);
308
318
  }
309
319
  case "value":
310
320
  return { text: formatMoneyCompact(row.value, currency, { code: currencyCode }), color: colors.text };
@@ -1,6 +1,6 @@
1
1
  import { Box, Text } from "../../../ui";
2
2
  import type { DataTableCell } from "../../../components";
3
- import { colors } from "../../../theme/colors";
3
+ import { colors, inactiveSelectedText } from "../../../theme/colors";
4
4
  import { blendForContrast } from "../../../theme/color-utils";
5
5
  import { clipToDisplayWidth, displayWidth } from "../../../utils/format";
6
6
  import type { InsiderTypeTone } from "./display";
@@ -24,10 +24,12 @@ export function insiderToneColor(tone: InsiderTypeTone): string {
24
24
  return tone === "buy" ? colors.positive : tone === "sell" ? colors.negative : colors.textDim;
25
25
  }
26
26
 
27
- function typeColor(tone: InsiderTypeTone, selected: boolean): string {
28
- if (tone === "neutral") return selected ? colors.selectedText : colors.textDim;
27
+ function typeColor(tone: InsiderTypeTone, selected: boolean, inactive: boolean): string {
28
+ // On the quieter fill of a pane without the keys, the row keeps its own colours, lifted to read there.
29
+ if (tone === "neutral") return !selected ? colors.textDim : inactive ? inactiveSelectedText(colors.textDim) : colors.selectedText;
29
30
  const color = insiderToneColor(tone);
30
- return selected ? blendForContrast(color, colors.selected, colors.selectedText, SELECTED_TONE_MIN_CONTRAST) : color;
31
+ if (!selected) return color;
32
+ return inactive ? inactiveSelectedText(color) : blendForContrast(color, colors.selected, colors.selectedText, SELECTED_TONE_MIN_CONTRAST);
31
33
  }
32
34
 
33
35
  function isoDay(date: Date | null): string | null {
@@ -38,7 +40,7 @@ export function renderInsiderCell(
38
40
  row: InsiderTableRow,
39
41
  column: InsiderColumn,
40
42
  _index: number,
41
- rowState: { selected: boolean },
43
+ rowState: { selected: boolean; inactive?: boolean },
42
44
  ): DataTableCell {
43
45
  // Awards, exercises and tax lines are context; buys and sales carry the figures.
44
46
  const figureColor = row.tone === "neutral" ? colors.textDim : colors.text;
@@ -50,12 +52,13 @@ export function renderInsiderCell(
50
52
  case "role":
51
53
  return { text: row.role, color: colors.textMuted };
52
54
  case "type": {
53
- const color = typeColor(row.tone, rowState.selected);
55
+ const inactive = rowState.inactive === true;
56
+ const color = typeColor(row.tone, rowState.selected, inactive);
54
57
  const text = insiderTypeText(row, column.plan === true);
55
58
  const markers = insiderTypeMarkers(row, column.plan === true);
56
59
  if (markers.length === 0) return { text, color, keepColorWhenSelected: true };
57
60
  // The markers read after the type in a quieter colour.
58
- const markerColor = rowState.selected ? colors.selectedText : colors.textMuted;
61
+ const markerColor = !rowState.selected ? colors.textMuted : inactive ? inactiveSelectedText(colors.textMuted) : colors.selectedText;
59
62
  const label = clipToDisplayWidth(row.type, column.width);
60
63
  const room = Math.max(0, column.width - displayWidth(label) - (label ? 1 : 0));
61
64
  return {
@@ -249,7 +249,7 @@ function TickersTradesView({ symbols, width, height, focused, viewBar }: Tickers
249
249
  </Box>
250
250
  );
251
251
  }
252
- const renderCell = (row: TickerTradeRow, column: TradeColumn, index: number, state: { selected: boolean }): DataTableCell =>
252
+ const renderCell = (row: TickerTradeRow, column: TradeColumn, index: number, state: { selected: boolean; inactive?: boolean }): DataTableCell =>
253
253
  column.id === "ticker"
254
254
  ? listingCell(row.ticker, colors, state.selected)
255
255
  : renderInsiderCell(row, column as InsiderColumn, index, state);
@@ -20,6 +20,10 @@ interface ReleaseOffsetRow {
20
20
  /** 25-delta put IV minus call IV, and the risk reversal, call minus put. */
21
21
  skew25d: number | null;
22
22
  rr25d: number | null;
23
+ /** What a policy decision did (held, raised 75bp) and the rate after it and before, where Gloom Cloud has them. */
24
+ decision: string | null;
25
+ actual: string | null;
26
+ prior: string | null;
23
27
  }
24
28
 
25
29
  export interface ReleaseOffsets {
@@ -132,6 +136,7 @@ export function releaseOffsetRows(
132
136
  iv30: iv30.get(date) ?? null, iv90: iv90.get(date) ?? null, iv365: iv365.get(date) ?? null,
133
137
  hv: hv.get(date) ?? null, spread: spread.get(date) ?? null,
134
138
  skew25d: skewValue, rr25d: skewValue == null ? null : -skewValue,
139
+ decision: release.figures?.decision ?? null, actual: release.figures?.actual ?? null, prior: release.figures?.prior ?? null,
135
140
  });
136
141
  }
137
142
  return result;