@gloom-sh/terminal 0.20.11 → 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 (242) hide show
  1. package/package.json +2 -1
  2. package/src/api-client/awards.ts +16 -0
  3. package/src/api-client/central-bank-rates.ts +5 -0
  4. package/src/api-client/data.ts +55 -2
  5. package/src/api-client/index.ts +18 -1
  6. package/src/api-client/request.ts +86 -3
  7. package/src/api-client/socket-connection.ts +12 -1
  8. package/src/api-client/socket.ts +21 -3
  9. package/src/api-client/supply-chain-graph.ts +4 -2
  10. package/src/api-client/supply-chain.ts +8 -0
  11. package/src/api-client/types/econ.ts +10 -7
  12. package/src/api-client/types/filings-and-calls.ts +8 -0
  13. package/src/app/global-shortcuts.ts +2 -1
  14. package/src/app/keybindings/actions.ts +19 -0
  15. package/src/app/pane-runtime/index.tsx +18 -3
  16. package/src/app/pane-runtime/layout-placement.ts +63 -0
  17. package/src/app/pane-runtime/ticker-open-runtime.ts +10 -2
  18. package/src/capabilities/chart-series.ts +4 -1
  19. package/src/cli/board-coins.ts +10 -1
  20. package/src/cli/commands/crypto-hints.ts +3 -2
  21. package/src/cli/commands/fred-series.ts +0 -54
  22. package/src/cli/commands/market.ts +209 -31
  23. package/src/cli/commands/overview.ts +47 -14
  24. package/src/cli/commands/search.ts +37 -8
  25. package/src/cli/commands/ticker.ts +15 -4
  26. package/src/cli/desktop-pane-shot.ts +27 -2
  27. package/src/cli/fx-quote-rate.ts +1 -1
  28. package/src/cli/glossary.ts +14 -5
  29. package/src/cli/history-catalog-series.ts +85 -0
  30. package/src/cli/index.ts +1 -1
  31. package/src/cli/list-progress.ts +45 -0
  32. package/src/cli/listing-arg.ts +71 -7
  33. package/src/cli/name-entries.ts +8 -4
  34. package/src/cli/not-a-ticker.ts +2 -2
  35. package/src/cli/pane-functions/freshness.ts +50 -3
  36. package/src/cli/pane-functions/index.ts +7 -4
  37. package/src/cli/pane-functions/market-session.ts +66 -14
  38. package/src/cli/pane-functions/options.ts +5 -0
  39. package/src/cli/pane-functions/resolver.ts +9 -2
  40. package/src/cli/pane-functions/screenshot-assessment.ts +28 -3
  41. package/src/cli/pane-functions/screenshot-types.ts +6 -0
  42. package/src/cli/quote-answer.ts +49 -10
  43. package/src/cli/quote-list-reads.ts +87 -0
  44. package/src/cli/report-tables.ts +70 -13
  45. package/src/cli/result.ts +24 -2
  46. package/src/cli/symbol-list.ts +31 -4
  47. package/src/cli/terminal-code-hints.ts +83 -0
  48. package/src/cli/ticker-resolution.ts +2 -1
  49. package/src/cli/treasury-yields.ts +5 -0
  50. package/src/components/command-bar/action-runtime.ts +2 -0
  51. package/src/components/command-bar/routing/launch-request.ts +2 -1
  52. package/src/components/command-bar/routing/navigation-state.ts +4 -2
  53. package/src/components/command-bar/workflow/types.ts +6 -0
  54. package/src/components/layout/detached-pane-shell.tsx +3 -0
  55. package/src/components/layout/double-escape-close.ts +34 -3
  56. package/src/components/layout/floating-pane.tsx +10 -4
  57. package/src/components/layout/pane/cycle-order.ts +66 -2
  58. package/src/components/layout/pane/header.tsx +140 -31
  59. package/src/components/layout/pane/sidebar.tsx +13 -5
  60. package/src/components/layout/pane/status-footer.ts +3 -1
  61. package/src/components/layout/shell/drag/runtime.ts +5 -0
  62. package/src/components/layout/shell/index.tsx +25 -0
  63. package/src/components/layout/shell/menu.ts +9 -0
  64. package/src/components/layout/shell/pane/actions.ts +36 -0
  65. package/src/components/layout/shell/pane/management-shortcuts.ts +27 -3
  66. package/src/components/layout/shell/pane-occlusion.ts +40 -0
  67. package/src/components/layout/shell/shortcuts.ts +17 -1
  68. package/src/components/layout/shell/terminal-pointer-runtime.ts +39 -6
  69. package/src/components/layout/shell/window-mode/index.ts +5 -16
  70. package/src/components/layout/shell/window-mode/overlays.tsx +3 -1
  71. package/src/components/market-board/index.tsx +14 -5
  72. package/src/components/metric-treemap/index.tsx +3 -1
  73. package/src/components/ui/button.tsx +48 -4
  74. package/src/components/ui/data-table/opentui/index.tsx +24 -9
  75. package/src/components/ui/data-table/types.ts +7 -0
  76. package/src/components/ui/inline-quick-add.tsx +19 -3
  77. package/src/components/ui/list-view.tsx +11 -5
  78. package/src/components/ui/query-bar.tsx +16 -1
  79. package/src/components/ui/selection-fill.ts +39 -0
  80. package/src/core/state/app/layout-reducer.ts +2 -1
  81. package/src/core/state/app/pane-choices.ts +68 -0
  82. package/src/core/state/app/state.ts +14 -6
  83. package/src/core/state/app/types.ts +8 -0
  84. package/src/layout/pane-manager/dock-tree.ts +19 -0
  85. package/src/layout/pane-manager/index.ts +3 -0
  86. package/src/market-data/market/freshness.ts +33 -0
  87. package/src/market-data/market/status.ts +5 -1
  88. package/src/market-data/quotes/contributions.ts +10 -0
  89. package/src/market-data/quotes/freshness.ts +19 -0
  90. package/src/market-data/quotes/live-valuation.ts +31 -4
  91. package/src/market-data/quotes/resolution.ts +4 -0
  92. package/src/market-data/quotes/time.ts +0 -14
  93. package/src/plugins/builtin/account-management/index.tsx +1 -0
  94. package/src/plugins/builtin/awards/detail.tsx +12 -4
  95. package/src/plugins/builtin/awards/headless.ts +29 -8
  96. package/src/plugins/builtin/awards/model.ts +36 -2
  97. package/src/plugins/builtin/awards/pane.tsx +7 -4
  98. package/src/plugins/builtin/broker-manager/index.tsx +1 -0
  99. package/src/plugins/builtin/broker-trading/index.tsx +1 -1
  100. package/src/plugins/builtin/central-bank-rates/headless.ts +6 -6
  101. package/src/plugins/builtin/central-bank-rates/index.tsx +1 -1
  102. package/src/plugins/builtin/central-bank-rates/model.ts +21 -3
  103. package/src/plugins/builtin/central-bank-rates/pane.tsx +15 -5
  104. package/src/plugins/builtin/chart-composer/headless.ts +5 -1
  105. package/src/plugins/builtin/chart-composer/pane.tsx +1 -0
  106. package/src/plugins/builtin/chat/content/handle-prompt.tsx +4 -0
  107. package/src/plugins/builtin/chat/controller/realtime.ts +17 -1
  108. package/src/plugins/builtin/chat/message/terminal.tsx +4 -1
  109. package/src/plugins/builtin/chat/sidebar.tsx +3 -4
  110. package/src/plugins/builtin/cloud/askg/pane.tsx +4 -0
  111. package/src/plugins/builtin/cloud/plugin.tsx +1 -0
  112. package/src/plugins/builtin/cloud/team/module.tsx +1 -0
  113. package/src/plugins/builtin/cloud/thesis/detail.tsx +9 -4
  114. package/src/plugins/builtin/commodity-balances/pane.tsx +13 -5
  115. package/src/plugins/builtin/company-kpis/model.ts +3 -3
  116. package/src/plugins/builtin/connections/index.ts +1 -0
  117. package/src/plugins/builtin/credit-boards/cdx-pane.tsx +9 -5
  118. package/src/plugins/builtin/credit-boards/client.ts +5 -0
  119. package/src/plugins/builtin/credit-boards/headless.ts +1 -6
  120. package/src/plugins/builtin/credit-boards/model.ts +0 -6
  121. package/src/plugins/builtin/credit-boards/series.ts +19 -8
  122. package/src/plugins/builtin/credit-boards/sovr-pane.tsx +9 -5
  123. package/src/plugins/builtin/crypto-etf-flows/headless.ts +23 -13
  124. package/src/plugins/builtin/crypto-etf-flows/pane.tsx +8 -3
  125. package/src/plugins/builtin/debt-maturities/headless.ts +16 -7
  126. package/src/plugins/builtin/debt-maturities/model.ts +9 -15
  127. package/src/plugins/builtin/debt-maturities/pane.tsx +9 -10
  128. package/src/plugins/builtin/earnings/board-model.ts +33 -4
  129. package/src/plugins/builtin/earnings/board.tsx +15 -3
  130. package/src/plugins/builtin/earnings/calendar.tsx +10 -6
  131. package/src/plugins/builtin/earnings/client.ts +0 -9
  132. package/src/plugins/builtin/earnings/headless.ts +10 -7
  133. package/src/plugins/builtin/earnings/history.tsx +21 -14
  134. package/src/plugins/builtin/earnings-calls/data.ts +24 -4
  135. package/src/plugins/builtin/earnings-calls/format.ts +23 -5
  136. package/src/plugins/builtin/earnings-calls/headless.ts +23 -3
  137. package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
  138. package/src/plugins/builtin/earnings-calls/model.ts +11 -1
  139. package/src/plugins/builtin/earnings-calls/pane.tsx +2 -5
  140. package/src/plugins/builtin/econ/calendar-model.ts +27 -0
  141. package/src/plugins/builtin/econ/fred-catalog.ts +3 -0
  142. package/src/plugins/builtin/econ/index.tsx +9 -2
  143. package/src/plugins/builtin/econ-statistics/headless.ts +3 -1
  144. package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
  145. package/src/plugins/builtin/fear-greed/headless.ts +16 -13
  146. package/src/plugins/builtin/fear-greed/pane.tsx +12 -4
  147. package/src/plugins/builtin/filing-events/index.tsx +1 -0
  148. package/src/plugins/builtin/fx-matrix/index.tsx +30 -19
  149. package/src/plugins/builtin/insider/table.tsx +10 -7
  150. package/src/plugins/builtin/insider/tickers.tsx +1 -1
  151. package/src/plugins/builtin/iv-history/headless.ts +9 -8
  152. package/src/plugins/builtin/jobs/index.tsx +1 -0
  153. package/src/plugins/builtin/macro-day/headless.ts +3 -3
  154. package/src/plugins/builtin/macro-day/model.ts +1 -1
  155. package/src/plugins/builtin/macro-day/releases.ts +25 -16
  156. package/src/plugins/builtin/market-movers/index.tsx +20 -8
  157. package/src/plugins/builtin/market-movers/model.ts +5 -0
  158. package/src/plugins/builtin/market-movers/session-body.tsx +2 -1
  159. package/src/plugins/builtin/money-markets/headless.ts +12 -2
  160. package/src/plugins/builtin/money-markets/pane.tsx +10 -1
  161. package/src/plugins/builtin/options/view.tsx +1 -0
  162. package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
  163. package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -31
  164. package/src/plugins/builtin/portfolio-list/pane/index.tsx +6 -1
  165. package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +22 -8
  166. package/src/plugins/builtin/portfolio-list/summary/index.tsx +6 -8
  167. package/src/plugins/builtin/portfolio-list/table.tsx +10 -1
  168. package/src/plugins/builtin/realized-vol/headless.ts +28 -2
  169. package/src/plugins/builtin/risk-factors/index.tsx +1 -0
  170. package/src/plugins/builtin/shared/source-footer.ts +70 -0
  171. package/src/plugins/builtin/short-interest/publications-pane.tsx +5 -1
  172. package/src/plugins/builtin/short-volume/pane.tsx +5 -1
  173. package/src/plugins/builtin/social-mentions/outliers.tsx +10 -1
  174. package/src/plugins/builtin/social-mentions/pane.tsx +7 -0
  175. package/src/plugins/builtin/supply-chain/client.ts +3 -1
  176. package/src/plugins/builtin/supply-chain/flow.tsx +25 -8
  177. package/src/plugins/builtin/supply-chain/graph-client.ts +1 -1
  178. package/src/plugins/builtin/supply-chain/graph-evidence.ts +1 -1
  179. package/src/plugins/builtin/supply-chain/graph-model.ts +12 -1
  180. package/src/plugins/builtin/supply-chain/graph-pane.tsx +9 -8
  181. package/src/plugins/builtin/supply-chain/graph.tsx +12 -6
  182. package/src/plugins/builtin/supply-chain/headless.ts +13 -7
  183. package/src/plugins/builtin/supply-chain/model.ts +68 -11
  184. package/src/plugins/builtin/supply-chain/pane.tsx +9 -6
  185. package/src/plugins/builtin/supply-chain/row-evidence.tsx +5 -5
  186. package/src/plugins/builtin/ticker-detail/overview/components.tsx +14 -1
  187. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +2 -0
  188. package/src/plugins/builtin/ticker-detail/pane.tsx +48 -24
  189. package/src/plugins/builtin/ticker-detail/quote-footer.ts +5 -0
  190. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +6 -3
  191. package/src/plugins/builtin/treasury-auctions/after.ts +50 -23
  192. package/src/plugins/builtin/treasury-auctions/cache.ts +23 -5
  193. package/src/plugins/builtin/treasury-auctions/headless.ts +226 -37
  194. package/src/plugins/builtin/treasury-auctions/hk-headless.ts +11 -5
  195. package/src/plugins/builtin/treasury-auctions/hk-view.tsx +27 -25
  196. package/src/plugins/builtin/treasury-auctions/hk.ts +60 -8
  197. package/src/plugins/builtin/treasury-auctions/index.tsx +3 -0
  198. package/src/plugins/builtin/treasury-auctions/keys.ts +27 -0
  199. package/src/plugins/builtin/treasury-auctions/like.ts +137 -0
  200. package/src/plugins/builtin/treasury-auctions/model.ts +100 -22
  201. package/src/plugins/builtin/treasury-auctions/pane.tsx +39 -11
  202. package/src/plugins/builtin/vol-surface/heat-grid.tsx +4 -2
  203. package/src/plugins/builtin/vol-surface/pane.tsx +5 -2
  204. package/src/plugins/runtime/index.tsx +1 -0
  205. package/src/plugins/runtime/state.ts +20 -0
  206. package/src/portfolio/column-values.ts +8 -2
  207. package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
  208. package/src/public/react.ts +7 -0
  209. package/src/react/auto-refresh.ts +29 -0
  210. package/src/renderers/browser/deeplink-bridge.ts +24 -3
  211. package/src/renderers/dom/desktop/query-bar.tsx +229 -60
  212. package/src/renderers/dom/host/overflow-fade-px.ts +2 -0
  213. package/src/renderers/dom/host/overflow-fade.ts +1 -2
  214. package/src/renderers/dom/styles.css +25 -5
  215. package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +2 -1
  216. package/src/series/types.ts +2 -0
  217. package/src/sources/gloomberb-cloud/fred-attribution.ts +86 -0
  218. package/src/sources/gloomberb-cloud/index.ts +25 -1
  219. package/src/sources/gloomberb-cloud/normalizers.ts +22 -3
  220. package/src/sources/provider-errors.ts +64 -1
  221. package/src/sources/provider-router/batches.ts +19 -0
  222. package/src/sources/provider-router/index.ts +7 -1
  223. package/src/state/app/context/index.tsx +24 -1
  224. package/src/state/pane-unsent-work.ts +47 -0
  225. package/src/test-support/shell-pane-keys.tsx +5 -0
  226. package/src/test-support/telemetry-guard.ts +83 -0
  227. package/src/test-support/test-env.ts +12 -0
  228. package/src/theme/colors.ts +17 -1
  229. package/src/theme/ui-tokens.ts +50 -1
  230. package/src/tickers/listing-venues.ts +11 -1
  231. package/src/tickers/search/japanese-names.json +1 -0
  232. package/src/tickers/search/japanese-names.ts +152 -0
  233. package/src/tickers/terminal-codes.ts +55 -6
  234. package/src/time-series/base-series.ts +3 -0
  235. package/src/types/data-provider.ts +6 -0
  236. package/src/types/financials.ts +11 -0
  237. package/src/types/plugin-contributions.ts +7 -0
  238. package/src/types/plugin-panes.ts +7 -0
  239. package/src/ui/host.tsx +6 -0
  240. package/src/utils/double-escape-close.ts +42 -0
  241. package/src/utils/fx-status.ts +30 -7
  242. package/src/utils/network-failure.ts +23 -0
@@ -15,6 +15,8 @@ import { formatPercentileRank } from "../../../utils/format";
15
15
  import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
16
16
  import { useResearchCloudSession } from "../shared/research-cloud-session";
17
17
  import { getCachedHongKongMoneyMarkets, getCachedMoneyMarkets, loadHongKongMoneyMarkets, loadMoneyMarkets } from "./client";
18
+ import { moneyMarketReport, moneyMarketsHeadless } from "./headless";
19
+ import { reportFooterSegment } from "../shared/source-footer";
18
20
  import { isHongKongTab, MONEY_MARKET_TABS, moneyMarketAxis, moneyMarketChange, moneyMarketCurves, moneyMarketNotices, moneyMarketObservations, moneyMarketRateChange, moneyMarketRowNotices, moneyMarketRows, moneyMarketValue } from "./model";
19
21
 
20
22
  const TABS = MONEY_MARKET_TABS.map(({ value, label }) => ({ value, label }));
@@ -128,6 +130,12 @@ export function MoneyMarketsPane({ width, height, focused }: PaneProps) {
128
130
  } : null;
129
131
  const figures = billsTab ? billsItems : [];
130
132
  const updatedAgo = useUpdatedAgo(active.updatedAt);
133
+ const sourceLine = useMemo(() => {
134
+ if (!shown) return null;
135
+ const report = moneyMarketReport(hongKong ? hongKongData?.rows ?? [] : data ? moneyMarketRows(data, tab) : [], hongKong);
136
+ return reportFooterSegment(moneyMarketsHeadless, { ...report.freshness ? { freshness: report.freshness } : {},
137
+ sections: [{ title: "", columns: [], rows: report.rows }] });
138
+ }, [data, hongKong, hongKongData, shown, tab]);
131
139
  const { strip: tabStrip, rows: tabRows } = usePaneTabs({ tabs: TABS, activeValue: tab, onSelect: setTab, focused, dense: true });
132
140
  const bodyHeight = Math.max(3, height - tabRows);
133
141
  useAutoRefresh(active.updatedAt, active.load);
@@ -137,7 +145,8 @@ export function MoneyMarketsPane({ width, height, focused }: PaneProps) {
137
145
  ...(active.data?.refreshError ? [active.data.refreshError] : [])] });
138
146
  usePaneStatusLinkFooter({ registrationId: "money-markets", focused, loading: active.loading, error: active.error,
139
147
  url: selected?.observation.sourceUrl ?? null, showOpenHint: true,
140
- info: shown && updatedAgo ? [ageFooterSegment(updatedAgo)] : [],
148
+ // Its source and the rows' dates, as `fn BTMM` ends; how long ago it loaded goes first on a narrow row.
149
+ info: shown ? [sourceLine!, ...(updatedAgo ? [ageFooterSegment(updatedAgo)] : [])] : [],
141
150
  stale: !!shown && active.data?.stale,
142
151
  });
143
152
  return <Box width={width} height={height} flexDirection="column">
@@ -359,6 +359,7 @@ export function OptionsView({ width, height, focused, nestedInTabs = false, ivRa
359
359
  id: "expiration",
360
360
  label: "Exp",
361
361
  inline: true,
362
+ scrolls: true,
362
363
  value: String(selectedExpiration),
363
364
  // The dates either side name the key that steps to them: a terminal
364
365
  // label prefix, a desktop tooltip.
@@ -334,7 +334,7 @@ function OptionsPositioningView({ width, height, focused, symbol }: PaneProps &
334
334
  usePaneNoticeFooter({ registrationId: "options-positioning:notices", focused, notices });
335
335
 
336
336
  const expiryFilter = (value: string, options: { value: string; label: string }[], onChange: (value: string) => void): QueryBarFilter => ({
337
- id: "expiry", label: "Exp", inline: true, value, onChange,
337
+ id: "expiry", label: "Exp", inline: true, scrolls: true, value, onChange,
338
338
  options: options.map((option, index) => ({
339
339
  ...option,
340
340
  hint: index === options.findIndex((entry) => entry.value === value) - 1 ? EXPIRY_PREVIOUS_KEY
@@ -8,6 +8,7 @@ import { splitSymbolArgs, splitSymbolWords, symbolInputKey } from "../../../../c
8
8
  import { notASymbolError } from "../../../../cli/symbol-cells";
9
9
  import { readSymbolList, SymbolListError } from "../../../../cli/symbol-list";
10
10
  import { cliStyles } from "../../../../utils/cli-output";
11
+ import { listProgressNotice } from "../../../../cli/list-progress";
11
12
  import { shellWord } from "../../../../utils/shell-word";
12
13
  import { logFailure } from "../../../../utils/log-failure";
13
14
  import { parsePublicTickerKey } from "../../../../utils/exchanges";
@@ -256,45 +257,17 @@ export function retryNotice(ctx: CliCommandContext): (count: number, waitMs: num
256
257
  };
257
258
  }
258
259
 
259
- /** A lookup this slow says how far it has got, so an add never looks stuck: first after two seconds, then every five. */
260
- const PROGRESS_AFTER_MS = 2_000;
261
- const PROGRESS_EVERY_MS = 5_000;
262
-
263
260
  /**
264
261
  * Lines on standard error while an add of several symbols is slow to look
265
262
  * them up: "Looking up 10 symbols." two seconds in when none is settled yet,
266
263
  * else "Looked up 4 of 10 symbols.", which it says again every five seconds
267
- * until all are. Nothing for one symbol or a lookup that is quick. It is told
268
- * (0, total) as the lookup starts and each symbol as it settles; the lines
269
- * come from a timer, so a lookup waiting on one slow answer still says so.
264
+ * until all are (`listProgressNotice`).
270
265
  */
271
266
  export function progressNotice(
272
267
  ctx: Pick<CliCommandContext, "cliOptions">,
273
- { afterMs = PROGRESS_AFTER_MS, everyMs = PROGRESS_EVERY_MS }: { afterMs?: number; everyMs?: number } = {},
268
+ timing: { afterMs?: number; everyMs?: number } = {},
274
269
  ): (looked: number, total: number) => void {
275
- let timer: ReturnType<typeof setTimeout> | undefined;
276
- let looked = 0, total = 0, told = false;
277
- const tell = () => {
278
- timer = undefined;
279
- if (looked >= total) return;
280
- console.error(cliStyles.muted(told || looked > 0 ? `Looked up ${looked} of ${total} symbols.` : `Looking up ${total} symbols.`));
281
- told = true;
282
- schedule(everyMs);
283
- };
284
- const schedule = (ms: number) => {
285
- timer = setTimeout(tell, ms);
286
- // The add's own end, not this line, decides when the process exits.
287
- (timer as { unref?: () => void }).unref?.();
288
- };
289
- return (settled, of) => {
290
- if (ctx.cliOptions.quiet || of < 2) return;
291
- looked = settled;
292
- total = of;
293
- if (looked >= total) {
294
- if (timer) clearTimeout(timer);
295
- timer = undefined;
296
- } else if (!timer) schedule(afterMs);
297
- };
270
+ return listProgressNotice(ctx, (looked, total, told) => told || looked > 0 ? `Looked up ${looked} of ${total} symbols.` : `Looking up ${total} symbols.`, timing);
298
271
  }
299
272
 
300
273
  /**
@@ -104,6 +104,7 @@ import { openPerpLabel, useOpenPerpMarket } from "../../perps/open-market";
104
104
  import { useLiveStreamingSetting } from "../../../../state/hooks/live-streaming";
105
105
  import { useThrottledTickerOrder } from "../use-throttled-ticker-order";
106
106
  import { useThrottledMemo } from "../use-throttled-memo";
107
+ import { useUtcDay } from "../../../../react/auto-refresh";
107
108
  import { perpetualDisplaySymbol, perpetualListing, perpetualVenueName } from "../../../../tickers/perpetual-listing";
108
109
  import { useColumnClock } from "../use-column-clock";
109
110
  import { liveMarketCapitalization } from "../../../../market-data/quotes/live-valuation";
@@ -672,6 +673,8 @@ export function PortfolioListPane({ focused, width, height }: PaneProps) {
672
673
  liveStreaming,
673
674
  });
674
675
 
676
+ // The quotes' time of today drops its day; the next day the footer names it.
677
+ const utcDay = useUtcDay();
675
678
  const summaryFooterInfo = useThrottledMemo(() => buildPortfolioFooterSegments({
676
679
  accountState: summaryAccountState,
677
680
  accountStatusText: accountsError
@@ -692,6 +695,7 @@ export function PortfolioListPane({ focused, width, height }: PaneProps) {
692
695
  portfolioSummaryTotals,
693
696
  refreshingSize,
694
697
  summaryAccountState,
698
+ utcDay,
695
699
  ], FOOTER_TOTALS_THROTTLE_MS);
696
700
  const fxWarning = !!(fxStatus.stale || fxStatus.unknownTime || fxStatus.unavailable);
697
701
  // Signed out or free, the rows' prices are the delayed ones; a list of coins is live and says nothing.
@@ -795,9 +799,10 @@ export function PortfolioListPane({ focused, width, height }: PaneProps) {
795
799
  ...offlineBrokerFooter.asOf,
796
800
  ...summaryFooterInfo,
797
801
  ...offlineBrokerFooter.status,
802
+ // The delay clock beside the quotes' source and time; the FX note after it gives way first on a narrow row.
803
+ ...(quoteDelay ? [quoteDelay] : []),
798
804
  ...(fxStatusText && !fxWarning ? [{ id: "fx", parts: [{ text: `FX ${fxStatusText}`, tone: "muted" as const }] }] : []),
799
805
  ...(showsPerpetuals && perpetuals.stale ? [{ id: "perpetuals", parts: [{ text: "perpetuals stale", tone: "warning" as const }] }] : []),
800
- ...(quoteDelay ? [quoteDelay] : []),
801
806
  ],
802
807
  hints: [
803
808
  ...offlineBrokerFooter.hints,
@@ -214,9 +214,20 @@ export function QuickAddTickerInput({
214
214
  keepFailureRef.current = false;
215
215
  listMemoRef.current = createQuickAddListMemo();
216
216
  setInputValue("");
217
+ // The field keeps its own text, cursor and scroll until told: an add that left them read the next symbol
218
+ // scrolled by one ("+ SDTRY=X" for USDTRY=X).
219
+ inputRef.current?.editBuffer?.setText?.("");
220
+ inputRef.current?.setCursorOffset?.(0);
217
221
  setValidation(IDLE_VALIDATION);
218
222
  }, []);
219
223
 
224
+ /** An add is done: the row closes, empty, and `a` opens it again. */
225
+ const closeAfterAdd = useCallback(() => {
226
+ resetInput();
227
+ inputRef.current?.blur?.();
228
+ setInputFocused(false);
229
+ }, [resetInput]);
230
+
220
231
  const clearFailedInput = useCallback((failure: QuickAddValidation) => {
221
232
  keepFailureRef.current = true;
222
233
  validationSeqRef.current += 1;
@@ -393,10 +404,13 @@ export function QuickAddTickerInput({
393
404
  ...skipped,
394
405
  ].join(" "),
395
406
  });
396
- if (added.length > 0 || left.length === 0) resetInput();
397
- else setValidation(list);
398
- queueMicrotask(() => inputRef.current?.focus?.());
399
- }, [addReady, collectionKind, collectionName, notify, onAdded, resetInput]);
407
+ // Something added, or nothing left to fix: done. Entries left out keep the row open on what to fix.
408
+ if (added.length > 0 || left.length === 0) closeAfterAdd();
409
+ else {
410
+ setValidation(list);
411
+ queueMicrotask(() => inputRef.current?.focus?.());
412
+ }
413
+ }, [addReady, closeAfterAdd, collectionKind, collectionName, notify, onAdded]);
400
414
 
401
415
  const submitInput = useCallback(async (submittedValue?: string) => {
402
416
  // Before any lookup: consent to count the add cannot be given after it.
@@ -435,7 +449,7 @@ export function QuickAddTickerInput({
435
449
  collection: collectionName,
436
450
  }),
437
451
  });
438
- resetInput();
452
+ closeAfterAdd();
439
453
  return;
440
454
  }
441
455
  if (currentValidation.status !== "ready") {
@@ -463,6 +477,7 @@ export function QuickAddTickerInput({
463
477
  collection: collectionName,
464
478
  }),
465
479
  });
480
+ closeAfterAdd();
466
481
  return;
467
482
  }
468
483
 
@@ -472,8 +487,7 @@ export function QuickAddTickerInput({
472
487
  collection: collectionName,
473
488
  });
474
489
  notify({ type: "success", body: added.note ? `${body} ${added.note}.` : body });
475
- resetInput();
476
- queueMicrotask(() => inputRef.current?.focus?.());
490
+ closeAfterAdd();
477
491
  } catch {
478
492
  setValidation({ status: "error", query, message: "Ticker add failed" });
479
493
  notify({ type: "error", body: tf("Failed to add {symbol}.", { symbol: query }) });
@@ -483,12 +497,12 @@ export function QuickAddTickerInput({
483
497
  }, [
484
498
  addReady,
485
499
  clearFailedInput,
500
+ closeAfterAdd,
486
501
  collectionName,
487
502
  handOffListingChoice,
488
503
  inputValue,
489
504
  notify,
490
505
  onAdded,
491
- resetInput,
492
506
  submitList,
493
507
  submitting,
494
508
  validateInput,
@@ -20,7 +20,7 @@ import {
20
20
  } from "../account-metrics";
21
21
  import { formatPortfolioAmount, type PortfolioSummaryTotals } from "./totals";
22
22
  import { formatAllocationDrift, formatAllocationWeight, type PortfolioCashLine } from "../../../../portfolio/allocation";
23
- import { getMostRecentQuoteUpdate } from "../../../../market-data/quotes/time";
23
+ import { quoteSourceFooterSegment } from "../../shared/source-footer";
24
24
  import { fxStatusLabel, type FxRateStatus } from "../../../../utils/fx-status";
25
25
  import { t } from "../../../../i18n";
26
26
  import type { PortfolioValuationBasis } from "../../../../portfolio/valuation-basis";
@@ -490,13 +490,11 @@ export function buildPortfolioFooterSegments({
490
490
  if (savedAt != null) return [...accountStatus, savedCopyFooterSegment("refresh", savedAt)];
491
491
  if (isPortfolioTab ? !totals.hasPositions && !accountStatusText : totals.watchlistCount === 0) return [];
492
492
 
493
- const lastRefreshTimestamp = getMostRecentQuoteUpdate(quotes);
494
- const refreshText = refreshingSize > 0
495
- ? "Refreshing..."
496
- : lastRefreshTimestamp != null
497
- ? new Date(lastRefreshTimestamp).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" })
498
- : "-";
499
- return [...accountStatus, { id: "refresh", parts: [{ text: refreshText, tone: "muted" }] }];
493
+ // Where the quotes are from and the newest's time, as `quote` ends (`Gloom Cloud · 14:44 UTC · markets open`):
494
+ // a bare local time ("Thu 12:25") named neither.
495
+ const quoted = refreshingSize > 0 ? null : quoteSourceFooterSegment(quotes, { id: "refresh" });
496
+ const refresh: PaneFooterSegment = quoted ?? { id: "refresh", parts: [{ text: refreshingSize > 0 ? "Refreshing..." : "-", tone: "muted" }] };
497
+ return [...accountStatus, refresh];
500
498
  }
501
499
 
502
500
  const MAX_NOTICE_SYMBOLS = 12;
@@ -17,6 +17,7 @@ import type { TickerRecord } from "../../../types/ticker";
17
17
  import { objectVersion } from "../../../utils/object-version";
18
18
  import { columnContextVersion, PERPETUAL_COLUMN_IDS } from "./cell-version";
19
19
  import { getColumnValue, type ColumnContext } from "./metrics";
20
+ import { RANGE_FROM_BARS_NOTE } from "../../../portfolio/column-values";
20
21
  import { periodPnlFigure, tickerDisplayName } from "../../../portfolio/column-values";
21
22
  import { listedSymbol } from "../../../portfolio/listed-symbol";
22
23
  import { displayWidth } from "../../../utils/format";
@@ -297,6 +298,12 @@ export function PortfolioTickerTable({
297
298
  priceColumn.width,
298
299
  ))
299
300
  : 0, [columnContext.valuationBasis, priceColumn, resolveCell, sortedTickers, tableFinancialsMap]);
301
+ // 52W% grows to show a range read from daily bars as one ("+45.30% bars"), as LAST grows for its session mark.
302
+ const rangeColumn = columns.find((column) => column.id === "range_52w");
303
+ const rangeWidth = useMemo(() => rangeColumn && sortedTickers.some((ticker) =>
304
+ tableFinancialsMap.get(ticker.metadata.ticker)?.quote?.yearRangeBasis === "daily-bars")
305
+ ? rangeColumn.width + displayWidth(RANGE_FROM_BARS_NOTE) + 1
306
+ : 0, [rangeColumn, sortedTickers, tableFinancialsMap]);
300
307
  // The Ticker column grows to its longest symbol, so ETH-USD and BA:LSE show whole beside their market-state dot.
301
308
  const tickerWidth = useMemo(() => Math.min(MAX_TICKER_COLUMN_WIDTH, sortedTickers.reduce(
302
309
  (widest, ticker) => Math.max(widest, TICKER_DOT_WIDTH + displayWidth(listedSymbol(ticker, tickerDisplayName(ticker), columnContext.homeMarket))),
@@ -311,13 +318,15 @@ export function PortfolioTickerTable({
311
318
  : column.id === "weight" && grossWeights ? { ...column, label: GROSS_WEIGHT_LABEL }
312
319
  : column.id === "ticker" && tickerWidth > column.width ? { ...column, width: tickerWidth }
313
320
  : column.id === "price" && priceWidth > column.width ? { ...column, width: priceWidth }
321
+ : column.id === "range_52w" && rangeWidth > column.width ? { ...column, width: rangeWidth }
314
322
  : column.id === "pnl_pct" && period ? { ...column, label: CONTRIBUTION_LABEL }
315
323
  : pnlLabel !== "P&L" && (column.id === "pnl" || column.id === "pnl_pct") ? {
316
324
  ...column,
317
325
  label: column.id === "pnl_pct" ? pnlLabel.replace("P&L", "%") : pnlLabel,
318
326
  } : column).map((column) => BOOK_CURRENCY_COLUMN_IDS.has(column.id) ? bookCurrencyColumn(column, capCurrency) : column)
319
327
  .map((column) => hasFrontReference && column.id === noteColumnId ? { ...column, flexGrow: 1 } : column),
320
- [capCurrency, columns, grossWeights, hasFrontReference, hasNonShareQuantity, noteColumnId, period, pnlLabel, priceWidth, sharesWidth, tickerWidth]);
328
+ [capCurrency, columns, grossWeights, hasFrontReference, hasNonShareQuantity, noteColumnId, period, pnlLabel, priceWidth, rangeWidth, sharesWidth,
329
+ tickerWidth]);
321
330
  // Read again as the rows' data moves, from the cells the rows show; the columns change only when what is hidden does.
322
331
  // The company columns hidden last time, per list, stay hidden while a row added since settles.
323
332
  const hiddenCompanyRef = useRef<{ list: string | undefined; ids: ReadonlySet<string> }>({ list: undefined, ids: new Set() });
@@ -3,7 +3,7 @@ import type { HeadlessPaneDefinition } from "../../../types/plugin";
3
3
  import { createSurfaceDependencies } from "../vol-surface/client";
4
4
  import { resolveHeadlessInstrument } from "../shared/headless-market-data";
5
5
  import { createRealizedVolatilityDependencies, loadCurrentAtmIv, loadRealizedVolatilityHistory } from "./client";
6
- import { atmIvObservedLabel, projectRealizedVolatility, type CurrentAtmIvSnapshot } from "./model";
6
+ import { atmIvObservedLabel, projectRealizedVolatility, type CurrentAtmIvSnapshot, type RealizedVolatilityModel } from "./model";
7
7
  import { ESTIMATOR_OPTIONS, selectedWindows } from "./settings";
8
8
  import { DAILY_CLOSES } from "../shared/report-freshness";
9
9
  import { listingAbroadVenue } from "../../../utils/sec";
@@ -30,10 +30,35 @@ function fxProxySection(proxy: FxVolProxy, reading: FxProxyReading): HeadlessBun
30
30
  formatted: proxy.iv30 ? `${proxy.iv30.date}${proxy.iv30.method === "quote-mid" ? " (quote mid)" : ""}${stale ? ", stale" : ""}` : "--" },
31
31
  { label: fxProxyChainLabel(proxy), value: proxy.expiries?.usable ?? null, formatted: fxProxyChainText(proxy, Date.now()) },
32
32
  { label: "Pair HV20", value: hv20, formatted: percent(hv20) },
33
- { label: "IV30 - HV20", value: spread, formatted: spread == null ? "--" : `${spread >= 0 ? "+" : ""}${(spread * 100).toFixed(2)} pts` },
33
+ // In points of volatility, which the label names, so an export writes the bare number.
34
+ { label: "IV30 - HV20 (pts)", value: spread, formatted: spread == null ? "--" : `${spread >= 0 ? "+" : ""}${(spread * 100).toFixed(2)}` },
34
35
  ] };
35
36
  }
36
37
 
38
+ /** Sessions of the history the text report prints; exports write every session of the lookback. */
39
+ const HISTORY_TEXT_SESSIONS = 10;
40
+
41
+ /**
42
+ * Each session's estimate for the windows shown, newest first, as HIVG's daily
43
+ * history is: the series the graph draws, which exports write as numbers in
44
+ * percent under one column per window (HV20 (%)). The text report prints the
45
+ * latest sessions.
46
+ */
47
+ function historySection(model: RealizedVolatilityModel): HeadlessBundleSection {
48
+ const rows = model.series.map((point) => ({
49
+ date: point.date.toISOString().slice(0, 10),
50
+ ...Object.fromEntries(model.windows.map((window) => [`hv${window}`, point.values[window] ?? null])),
51
+ })).reverse();
52
+ return {
53
+ title: "History",
54
+ textTitle: `History, latest ${Math.min(HISTORY_TEXT_SESSIONS, rows.length)} sessions`,
55
+ columns: [{ key: "date", header: "Date" }, ...model.windows.map((window) => ({ key: `hv${window}`, header: `HV${window}`,
56
+ format: (value: unknown) => typeof value === "number" ? `${(value * 100).toFixed(2)}%` : "--" }))],
57
+ rows,
58
+ textRows: rows.slice(0, HISTORY_TEXT_SESSIONS),
59
+ };
60
+ }
61
+
37
62
  export function realizedVolHeadless(initialView: "graph" | "cone"): HeadlessPaneDefinition<"bundle"> {
38
63
  return {
39
64
  shape: "bundle", argument: { kind: "ticker", description: "Underlying ticker" }, currencyPairs: true,
@@ -102,6 +127,7 @@ export function realizedVolHeadless(initialView: "graph" | "cone"): HeadlessPane
102
127
  { key: "percentile", header: "Percentile", format: (value) => typeof value === "number" ? `${value.toFixed(1)}%` : "--" },
103
128
  { key: "sampleSize", header: "Samples" },
104
129
  ], rows: model.cone.map((row) => ({ ...row })) },
130
+ ...model.series.length > 0 ? [historySection(model)] : [],
105
131
  ...proxy && proxyReading ? [fxProxySection(proxy, proxyReading)] : fx || !args.options.showIv ? [] : [{ title: "Current IV", entries: [
106
132
  { label: "ATM IV", value: iv?.reference?.value ?? null, formatted: iv?.reference ? `${(iv.reference.value * 100).toFixed(2)}%` : "--" },
107
133
  { label: "Expiry", value: iv?.reference?.expiration ?? null,
@@ -24,6 +24,7 @@ export const riskFactorsModule: PluginModule = {
24
24
  component: RiskFactorsResearchTab,
25
25
  instruments: ["equity"],
26
26
  isVisible: ({ ticker }) => !isKnownNonUsListing(ticker),
27
+ proOnly: true,
27
28
  });
28
29
  },
29
30
 
@@ -0,0 +1,70 @@
1
+ import type { PaneFooterSegment } from "../../../components/layout/pane/footer";
2
+ import { deriveHeadlessFreshness, paneSourceLineVariants, type ReportFreshness } from "../../../cli/pane-functions/freshness";
3
+ import { quotesFreshness } from "../../../cli/freshness";
4
+ import { quoteSourceName } from "../../../market-data/quotes/export-identity";
5
+ import { quoteHeadlineTime } from "../../../market-data/market/status";
6
+ import type { Quote } from "../../../types/financials";
7
+ import type { HeadlessPaneDefinition, HeadlessPaneResult } from "../../../types/headless";
8
+ import { getSharedRegistry } from "../../registry";
9
+
10
+ /**
11
+ * The footer's one form for where a pane's data comes from and how current it
12
+ * is, the line its `fn` report ends with (paneSourceLineVariants): `DTCC · Thu
13
+ * 12 Nov 2026 · not a live feed (daily levels of public trades)`. A narrow row
14
+ * shortens it to the source and the date, then the date alone. `feed: false`
15
+ * leaves out the delay a pane's clock already shows.
16
+ */
17
+ function sourceFooterSegment(
18
+ freshness: ReportFreshness,
19
+ { id = "source", feed = true, time }: {
20
+ id?: string;
21
+ feed?: boolean;
22
+ /** The data's time in its fewest cells (`12:25 UTC`), for a row too narrow for the line's own date: after the sourced lines and last. */
23
+ time?: string;
24
+ } = {},
25
+ ): PaneFooterSegment {
26
+ const lines = paneSourceLineVariants(freshness, { feed });
27
+ const sourced = freshness.source ? lines.filter((line) => line.startsWith(`${freshness.source} · `)) : [];
28
+ const ordered = time
29
+ ? [...sourced, ...freshness.source ? [`${freshness.source} · ${time}`] : [], ...lines.filter((line) => !sourced.includes(line)), time]
30
+ : lines;
31
+ const [line, ...shorter] = [...new Set(ordered)].map((text) => [{ text, tone: "muted" as const }]);
32
+ return { id, asOf: true, parts: line!, ...(shorter.length ? { variants: shorter } : {}) };
33
+ }
34
+
35
+ /** `12:25 UTC` on the day it is read, `Thu 12 Nov 12:25 UTC` before. */
36
+ function compactTime(time: number, now: number): string {
37
+ const at = new Date(time);
38
+ const clock = `${at.toISOString().slice(11, 16)} UTC`;
39
+ if (at.toISOString().slice(0, 10) === new Date(now).toISOString().slice(0, 10)) return clock;
40
+ return `${at.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short", timeZone: "UTC" }).replace(",", "")} ${clock}`;
41
+ }
42
+
43
+ /** {@link sourceFooterSegment} for a pane's data read as its report reads it: the definition's freshness over `result`. */
44
+ export function reportFooterSegment(
45
+ definition: Pick<HeadlessPaneDefinition, "shape" | "freshness">,
46
+ result: HeadlessPaneResult,
47
+ options: { id?: string; feed?: boolean; now?: number } = {},
48
+ ): PaneFooterSegment {
49
+ return sourceFooterSegment(deriveHeadlessFreshness(definition, result, options.now), options);
50
+ }
51
+
52
+ /**
53
+ * {@link sourceFooterSegment} for the quotes a pane shows, as `quote` ends: where they are from (Gloom Cloud, a
54
+ * broker by its name) and the newest's session or time, `Gloom Cloud · EGX trading day Thu 12 Nov 2026 close`,
55
+ * down to `Gloom Cloud · 12:25 UTC` and the time alone in a narrow pane. Its delay is left to the pane's clock.
56
+ * A quote whose source has no name to give leaves the source out rather than calling it Gloom Cloud. Null with
57
+ * no quote.
58
+ */
59
+ export function quoteSourceFooterSegment(
60
+ quotes: Iterable<Quote | null | undefined>,
61
+ { id = "source", now = Date.now() }: { id?: string; now?: number } = {},
62
+ ): PaneFooterSegment | null {
63
+ const shown = [...quotes].filter((quote): quote is Quote => quote != null && quote.lastUpdated > 0);
64
+ const names = [...new Set(shown.map((quote) => quoteSourceName(quote, (providerId) => getSharedRegistry()?.getBrokerAdapter(providerId)?.name)))];
65
+ const source = names.length > 0 && names.every(Boolean) ? names.join(" and ") : "";
66
+ const freshness = quotesFreshness(shown, undefined, now);
67
+ if (!freshness) return null;
68
+ const newest = Math.max(...shown.map((quote) => quoteHeadlineTime(quote)));
69
+ return sourceFooterSegment({ ...freshness, source }, { id, feed: false, ...Number.isFinite(newest) && newest > 0 ? { time: compactTime(newest, now) } : {} });
70
+ }
@@ -10,6 +10,8 @@ import type { PaneProps } from "../../../types/plugin";
10
10
  import { isKnownNonUsEquityTicker } from "../../../utils/sec";
11
11
  import { listingIdentity } from "../shared/ticker-request";
12
12
  import { cachedPublication, loadPublication, type PublicationKind } from "./publications-client";
13
+ import { publicationHeadless } from "./publications-headless";
14
+ import { reportFooterSegment } from "../shared/source-footer";
13
15
  import { publicationCell, publicationColumns, publicationRows, sharedFailIdentity, type PublicationColumn, type PublicationRow } from "./publications-model";
14
16
 
15
17
  function renderCell(row: PublicationRow, column: PublicationColumn, _index: number, state: { selected: boolean }): DataTableCell {
@@ -48,7 +50,9 @@ export function ShortSidePublicationPane({ kind, width, height, focused }: Pick<
48
50
  notices: [...(data?.warnings ?? []), ...(resource.data?.refreshError ? [resource.data.refreshError] : [])] });
49
51
  usePaneStatusLinkFooter({ registrationId: kind, focused, loading: resource.loading, error: resource.error,
50
52
  url: selected?.sourceUrl ?? data?.source.url ?? null, showOpenHint: true,
51
- info: data && updatedAgo ? [ageFooterSegment(updatedAgo)] : [],
53
+ // Its source and newest date, as `fn FTD` and `fn ATS` end; how long ago it loaded goes first on a narrow row.
54
+ info: data ? [reportFooterSegment(publicationHeadless(kind), { sections: [{ title: "", columns: [], rows: publicationRows(data) }] }),
55
+ ...(updatedAgo ? [ageFooterSegment(updatedAgo)] : [])] : [],
52
56
  stale: !!data && resource.data?.stale,
53
57
  });
54
58
  if (!symbol) return <EmptyState title="No ticker selected." message={`Select a US stock to view ${subject}.`} />;
@@ -14,6 +14,8 @@ import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
14
14
  import { SignInWall } from "../cloud/auth-actions";
15
15
  import { isCloudSessionRequired, useResearchCloudSession } from "../shared/research-cloud-session";
16
16
  import { cachedShortVolume, loadShortVolume } from "./client";
17
+ import { shortVolumeHeadless } from "./headless";
18
+ import { reportFooterSegment } from "../shared/source-footer";
17
19
  import { exactQuantity, sortedVolumeHistory, VOLUME_COLUMNS, volumeChange, volumeHistoryPoints, volumePercent, volumePointStatus, volumeQuantity, type VolumeColumn, type VolumeSort } from "./model";
18
20
  import { usePaneTickerIdentity } from "../../../state/hooks/pane-ticker";
19
21
 
@@ -84,7 +86,9 @@ export function ShortVolumePane({ width, height, focused }: Pick<PaneProps, "wid
84
86
  notices: [...(data?.warnings ?? []), ...(resource.data?.refreshError ? [resource.data.refreshError] : [])] });
85
87
  usePaneStatusLinkFooter({ registrationId: "short-volume", focused, loading: resource.loading, error: resource.error,
86
88
  url: selected?.sourceUrl ?? data?.source.url ?? null, showOpenHint: true,
87
- info: data && updatedAgo ? [ageFooterSegment(updatedAgo)] : [],
89
+ // Its source and newest day, as `fn SIV` ends; how long ago it loaded goes first on a narrow row.
90
+ info: data ? [reportFooterSegment(shortVolumeHeadless, { sections: [{ title: "", columns: [], rows: data.history.map((point) => ({ date: point.date })) }] }),
91
+ ...(updatedAgo ? [ageFooterSegment(updatedAgo)] : [])] : [],
88
92
  stale: !!data && resource.data?.stale,
89
93
  });
90
94
  if (!data && isCloudSessionRequired(resource.error)) return <SignInWall placement="short-volume-signin" action="view daily short volume" needsVerification={session.needsVerification} />;
@@ -11,6 +11,9 @@ import {
11
11
  } from "../../../components";
12
12
  import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
13
13
  import { ageFooterSegment } from "../../../components/layout/pane/footer";
14
+ import { useUtcDay } from "../../../react/auto-refresh";
15
+ import { reportFooterSegment } from "../shared/source-footer";
16
+ import { socialMentionsHeadless } from "./headless";
14
17
  import { useAsyncResource, useAutoRefresh, useMarketData, usePluginPaneState, useUpdatedAgo } from "../../../public/react";
15
18
  import { useThemeColors } from "../../../theme/theme-context";
16
19
  import { Box } from "../../../ui";
@@ -154,13 +157,19 @@ export function SocialOutliersView({ width, height, focused, renderTicker }: {
154
157
  }, [setOpenName, setOpenSymbol]);
155
158
 
156
159
  const updatedAgo = useUpdatedAgo(resource.updatedAt);
160
+ const utcDay = useUtcDay();
161
+ // Its source and when the posts were counted, as `fn BUZZ` ends; how long ago it loaded goes first on a narrow row.
162
+ const footerInfo = useMemo(() => data ? [
163
+ reportFooterSegment(socialMentionsHeadless, { sections: [], metadata: { asOf: data.asOf } }),
164
+ ...(updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
165
+ ] : [], [data, updatedAgo, utcDay]);
157
166
  usePaneStatusFooter({
158
167
  registrationId: "social-mentions:outliers",
159
168
  enabled: !detailOpen,
160
169
  loading: resource.loading,
161
170
  error: data ? resource.error : null,
162
171
  stale: !!data && !!shown?.stale,
163
- info: data && updatedAgo ? [ageFooterSegment(updatedAgo)] : [],
172
+ info: footerInfo,
164
173
  });
165
174
  usePaneNoticeFooter({
166
175
  registrationId: "social-mentions:outliers:notices",
@@ -4,6 +4,9 @@ import { Box, ScrollBox, Text, useUiCapabilities } from "../../../ui";
4
4
  import { useAsyncResource, useAutoRefresh, usePaneSettingValue, usePluginPaneState, useShortcut, useUpdatedAgo } from "../../../public/react";
5
5
  import { CompositeChart, DataTableStackView, EmptyState, PaneStatusBody, usePaneNoticeFooter, usePaneStatusLinkFooter, type DataTableCell, StatGrid } from "../../../components";
6
6
  import { ageFooterSegment } from "../../../components/layout/pane/footer";
7
+ import { useUtcDay } from "../../../react/auto-refresh";
8
+ import { reportFooterSegment } from "../shared/source-footer";
9
+ import { socialMentionsHeadless } from "./headless";
7
10
  import { colors } from "../../../theme/colors";
8
11
  import type { SocialMentionPost, SocialMentionsRange } from "../../../api-client/social-mentions";
9
12
  import { staticSeries } from "../../../components/chart/static/series";
@@ -119,6 +122,8 @@ function SocialMentionsTickerView({ width, height, focused, listingKey, onDetail
119
122
  return () => clearTimeout(timer);
120
123
  }, [pending, resource.updatedAt, resource.reload]);
121
124
  useAutoRefresh(resource.updatedAt, resource.load);
125
+ // The footer leaves the day off a time of today; the next day it names it.
126
+ useUtcDay();
122
127
  const dayOpen = !!openRow;
123
128
  useEffect(() => onDetailChange?.(dayOpen), [dayOpen, onDetailChange]);
124
129
  useEffect(() => () => onDetailChange?.(false), [onDetailChange]);
@@ -129,7 +134,9 @@ function SocialMentionsTickerView({ width, height, focused, listingKey, onDetail
129
134
  const signInWall = !data && isCloudSessionRequired(resource.error);
130
135
  usePaneStatusLinkFooter({ registrationId: "social-mentions", focused, loading: resource.loading || pending, error: signInWall ? null : resource.error,
131
136
  url: selected?.topPost?.url ?? (symbol ? `https://x.com/search?q=%24${symbol}` : null), showOpenHint: true,
137
+ // Its source and when the posts were counted, as `fn BUZZ` ends; how long ago it loaded goes first on a narrow row.
132
138
  info: data ? [
139
+ reportFooterSegment(socialMentionsHeadless, { sections: [], metadata: { asOf: data.asOf } }),
133
140
  ...(updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
134
141
  ...(resource.data?.stale ? [{ id: "stale", parts: [{ text: "stale", tone: "warning" as const }] }] : []),
135
142
  ] : [],
@@ -32,7 +32,8 @@ function evidence(value: SupplyEvidenceItem): boolean {
32
32
  && finite(value.confidence) && value.confidence >= 0 && value.confidence <= 1
33
33
  && ["active", "superseded", "rejected", "stale"].includes(value.status)
34
34
  && (value.verificationStatus === undefined || ["verified", "lead"].includes(value.verificationStatus))
35
- && nullableText(value.valueKind) && (value.value === null || finite(value.value)) && nullableText(value.valueUnit) && nullableText(value.currency);
35
+ && nullableText(value.valueKind) && (value.value === null || finite(value.value)) && nullableText(value.valueUnit) && nullableText(value.currency)
36
+ && (value.relatedParty === undefined || typeof value.relatedParty === "boolean");
36
37
  }
37
38
  export function validSupplyEntity(value: SupplyEntity): boolean {
38
39
  return !!value && text(value.id) && text(value.name) && nullableText(value.ticker) && nullableText(value.exchange)
@@ -53,6 +54,7 @@ export function validSupplyRow(value: SupplyRow): boolean {
53
54
  && (value.nativeAmount == null || (value.nativeCurrency != null && value.nativeScale != null && Number.isFinite(value.nativeAmount * value.nativeScale)))
54
55
  && (value.jurisdiction == null || (text(value.jurisdiction) && /^[A-Z]{2}$/.test(value.jurisdiction)))
55
56
  && [undefined, null, "entity", "group", "anonymous", "aggregate"].includes(value.entityScope)
57
+ && (value.relatedParty === undefined || typeof value.relatedParty === "boolean")
56
58
  && (value.pctOfRevenue === null || value.pctBasis !== null) && (value.usd === null || value.usdBasis !== null)
57
59
  && text(value.period) && validPeriodMonths(value.periodMonths) && nullableText(value.fiscalYear) && ["xbrl", "filing_text", "call", "news", "web", "import", "press_release"].includes(value.sourceKind)
58
60
  && nullableText(value.form) && (value.filedDate === null || date(value.filedDate)) && date(value.asOf)