@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
@@ -27,7 +27,9 @@ import { isPlainArrowUp, stopSearchFocusNavigation } from "../../../utils/search
27
27
  import { cycleSortPreference, nextHeaderSort } from "../../../utils/sort-values";
28
28
  import { usePluginPaneState } from "../../runtime";
29
29
  import { useAsyncResource } from "../../../react/async-resource";
30
- import { useAutoRefresh } from "../../../react/auto-refresh";
30
+ import { useAutoRefresh, useUtcDay } from "../../../react/auto-refresh";
31
+ import { reportFooterSegment } from "../shared/source-footer";
32
+ import { treasuryAuctionsHeadless } from "./headless";
31
33
  import { useCommandValue } from "../shared/command-tab";
32
34
  import { FIXED_INCOME_PANE_ID } from "../fixed-income/model";
33
35
  import {
@@ -46,8 +48,8 @@ import {
46
48
  auctionHistoryPhrase,
47
49
  auctionHistoryWindow,
48
50
  auctionSize,
49
- auctionSortColumn,
50
51
  buildAuctionColumns,
52
+ compactTerm,
51
53
  dealerPct,
52
54
  directPct,
53
55
  firstAuctionSortDirection,
@@ -58,6 +60,7 @@ import {
58
60
  isPendingAuction,
59
61
  nextAuctionHistoryWindow,
60
62
  nextFilter,
63
+ parseAuctionSort,
61
64
  rateLabel,
62
65
  rateValue,
63
66
  middleRateLabel,
@@ -76,6 +79,7 @@ import {
76
79
  } from "./types";
77
80
  import { AUCTION_MARKETS, isAuctionMarket, type AuctionMarket } from "./hk";
78
81
  import { HkTendersView } from "./hk-view";
82
+ import { auctionViewHints } from "./keys";
79
83
 
80
84
  function formatRate(value: number | null): string {
81
85
  return value == null ? "—" : `${value.toFixed(3)}%`;
@@ -132,6 +136,10 @@ function secTypeColor(secType: string, selected: boolean): string {
132
136
  /** An announced auction's Rate in the table, the word other panes use for a figure not out yet (KPI's Later actual). */
133
137
  const RESULTS_PENDING = "Pending";
134
138
 
139
+ const PERCENTILE_KEYS = {
140
+ stopOutPctl: "stopOutPercentile", btcPctl: "btcPercentile", indirectPctl: "indirectPercentile", dealerPctl: "dealerPercentile",
141
+ } as const;
142
+
135
143
  // Stable table adapter so memoized rows survive pane re-renders.
136
144
  const auctionKey = (auction: TreasuryAuction) => auction.id;
137
145
 
@@ -160,7 +168,7 @@ function renderAuctionCell(
160
168
  attributes: TextAttributes.BOLD,
161
169
  };
162
170
  case "term":
163
- return { text: auction.securityTerm, color: selected ?? colors.text };
171
+ return { text: column.compact ? compactTerm(auction.securityTerm) : auction.securityTerm, color: selected ?? colors.text };
164
172
  case "rate":
165
173
  // An announced auction says its results are pending, as its detail does; other metric cells stay "—".
166
174
  return isPendingAuction(auction)
@@ -180,10 +188,11 @@ function renderAuctionCell(
180
188
  return { text: formatMoney(auctionSize(auction)), color: dimmed };
181
189
  case "cusip":
182
190
  return { text: auction.cusip ?? "", color: dimmed };
191
+ case "stopOutPctl":
183
192
  case "btcPctl":
184
193
  case "indirectPctl":
185
194
  case "dealerPctl": {
186
- const key = column.id === "btcPctl" ? "btcPercentile" : column.id === "indirectPctl" ? "indirectPercentile" : "dealerPercentile";
195
+ const key = PERCENTILE_KEYS[column.id];
187
196
  const value = after?.[key] ?? null;
188
197
  return { text: value == null ? "" : String(value), value, color: selected ?? colors.text };
189
198
  }
@@ -238,6 +247,10 @@ function TreasuryAuctionDetail({ auction, width, after }: { auction: TreasuryAuc
238
247
  <KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="Primary dealer" value={share(auction.primaryDealerAccepted, auction.competitiveAccepted)} />
239
248
  {after && <>
240
249
  <Box height={1} />
250
+ {stopOutVsAvgBp(auction) != null && (
251
+ <KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label={`${stopOutLabel(auction)} pctl`}
252
+ value={after.stopOutPercentile == null ? "—" : String(after.stopOutPercentile)} />
253
+ )}
241
254
  <KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="B/C percentile" value={after.btcPercentile == null ? "—" : String(after.btcPercentile)} />
242
255
  <KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="Indirect percentile" value={after.indirectPercentile == null ? "—" : String(after.indirectPercentile)} />
243
256
  <KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="Dealer percentile" value={after.dealerPercentile == null ? "—" : String(after.dealerPercentile)} />
@@ -253,13 +266,17 @@ function TreasuryAuctionDetail({ auction, width, after }: { auction: TreasuryAuc
253
266
 
254
267
  const NO_AUCTIONS: TreasuryAuction[] = [];
255
268
 
256
- /** A sort as kept in pane state and typed after --sort: the column's name, and `:asc` or `:desc` once the pane flips it. */
269
+ /**
270
+ * A sort as kept in pane state and typed after --sort: the column's name, `-`
271
+ * first for the other way round (`-indirect-pctl`, lowest first), and `:asc`
272
+ * or `:desc` once the pane flips it.
273
+ */
257
274
  function readSort(value: string | null): AuctionSortPreference | null {
258
275
  if (!value) return null;
259
276
  const [name, direction] = value.split(":");
260
- const columnId = auctionSortColumn(name ?? "");
261
- if (!columnId) return null;
262
- return { columnId, direction: direction === "asc" || direction === "desc" ? direction : firstAuctionSortDirection(columnId) };
277
+ const sort = parseAuctionSort(name ?? "");
278
+ if (!sort) return null;
279
+ return direction === "asc" || direction === "desc" ? { columnId: sort.columnId, direction } : sort;
263
280
  }
264
281
 
265
282
  function writeSort(sort: AuctionSortPreference): string | null {
@@ -393,6 +410,8 @@ function UsAuctionsView({
393
410
  const columns = next === "after" ? AUCTION_AFTER_SORT_COLUMN_IDS : AUCTION_SORT_COLUMN_IDS;
394
411
  if (!columns.includes(sortPreference.columnId)) setSortValue(null);
395
412
  }, [setSortValue, setView, sortPreference.columnId]);
413
+ const toggleView = useCallback(() => selectView(view === "after" ? "results" : "after"), [selectView, view]);
414
+ const toggleMarket = useCallback(() => marketFilter.onChange("hk"), [marketFilter]);
396
415
 
397
416
  usePaneRefreshKey(() => resource.reload(), { focused, enabled: !searchFocused });
398
417
 
@@ -422,7 +441,7 @@ function UsAuctionsView({
422
441
  return handlePaneKey(event);
423
442
  }, [focusSearch, handlePaneKey]);
424
443
 
425
- const showYear = auctionDatesShowYear(historyDays);
444
+ const showYear = useMemo(() => auctionDatesShowYear(rows.map((auction) => auction.auctionDate)), [rows]);
426
445
  // A table that scrolls down keeps a cell for its scrollbar.
427
446
  const columns = useMemo(() => buildAuctionColumns({ showYear, view, rows, width: width - 1 }), [rows, showYear, view, width]);
428
447
  const renderAuctionRow = useCallback((
@@ -432,12 +451,15 @@ function UsAuctionsView({
432
451
  rowState: { selected: boolean },
433
452
  ) => renderAuctionCell(auction, column, rowState, showYear, after?.get(auction.id)), [after, showYear]);
434
453
 
454
+ const utcDay = useUtcDay();
435
455
  usePaneFooter(TREASURY_AUCTIONS_PANE_ID, () => {
436
456
  const info = loadingErrorFooterInfo(loading, error);
437
457
  if (yieldsError) info.push({ id: "yields", parts: [{ text: "Treasury yields unavailable", tone: "warning" as const }] });
438
458
  if (savedAt != null) info.push(...savedCopyFooterInfo([savedAt]));
439
459
  else if (stale) info.push(STALE_SEGMENT);
440
460
  if (fetchedAt && savedAt == null) {
461
+ // Its source and the newest auction listed, as `fn AUCT` ends; how long ago it loaded goes first on a narrow row.
462
+ if (rows.length) info.push(reportFooterSegment(treasuryAuctionsHeadless, { rows: rows.map((auction) => ({ auctionDate: auction.auctionDate })) }));
441
463
  info.push(ageFooterSegment(formatRelativeAge(fetchedAt)));
442
464
  }
443
465
  return {
@@ -447,24 +469,30 @@ function UsAuctionsView({
447
469
  : [
448
470
  { id: "search", key: "/", label: "search", onPress: focusSearch },
449
471
  { id: "filter", key: "f", label: "ilter", onPress: cycleFilter },
472
+ ...auctionViewHints({ view, toggleView, market: "us", toggleMarket, cycleSort }),
450
473
  ],
451
474
  };
452
475
  }, [
453
476
  auctions.length,
454
477
  cycleFilter,
478
+ cycleSort,
479
+ toggleMarket,
480
+ toggleView,
481
+ view,
455
482
  detailOpen,
456
483
  error,
457
484
  yieldsError,
458
485
  fetchedAt,
459
486
  focusSearch,
460
487
  loading,
488
+ rows,
461
489
  savedAt,
462
490
  stale,
491
+ utcDay,
463
492
  ]);
464
493
 
465
- // The pane menu names the sort keys; "Sort by…" there picks a column directly.
494
+ // The footer's [] steps to the next sort column; the pane menu names the way back. "Sort by…" there picks a column directly.
466
495
  usePaneMenuItems("treasury-auctions:sort-keys", () => detailOpen || auctions.length === 0 ? null : [
467
- { id: "sort-next", label: "Next Sort Column", accelerator: "]", onSelect: () => cycleSort(1) },
468
496
  { id: "sort-previous", label: "Previous Sort Column", accelerator: "[", onSelect: () => cycleSort(-1) },
469
497
  ], [auctions.length, cycleSort, detailOpen]);
470
498
 
@@ -1,6 +1,7 @@
1
1
  import { DataTableView, Notice, type DataTableColumn } from "../../../components";
2
2
  import { turbo } from "../../../components/chart/surface3d/model";
3
3
  import { useThemeColors } from "../../../theme/theme-context";
4
+ import { useSelectionFill } from "../../../components/ui/selection-fill";
4
5
  import { Box, Text } from "../../../ui";
5
6
  import { deltaLabel, tenorLabel, type SurfaceCell, type VolatilitySurfaceGrid } from "./raster";
6
7
 
@@ -74,6 +75,7 @@ export interface SurfaceHeatGridProps {
74
75
  */
75
76
  export function SurfaceHeatGrid({ grid, range, ticks, selected, onSelect, width, height, notice }: SurfaceHeatGridProps) {
76
77
  const colors = useThemeColors();
78
+ const selectionFill = useSelectionFill();
77
79
  const shown = heatGridColumns(grid.moneyness, width);
78
80
  const columns: DataTableColumn[] = [{ id: "tenor", label: "Expiry", width: LABEL_WIDTH, align: "left" },
79
81
  ...shown.map((column) => ({ id: String(column), label: grid.axis === "delta" ? deltaLabel(grid.moneyness[column]!) : `${Math.round(grid.moneyness[column]! * 100)}%`,
@@ -98,8 +100,8 @@ export function SurfaceHeatGrid({ grid, range, ticks, selected, onSelect, width,
98
100
  const onMouseDown = () => onSelect({ tenorIndex: row.index, moneynessIndex: index });
99
101
  if (value == null || !Number.isFinite(value)) return { text: "--", color: colors.textMuted, onMouseDown };
100
102
  const fill = surfaceColorHex(value, range);
101
- return { text: (value * 100).toFixed(1), color: chosen ? colors.selectedText : surfaceTextColor(fill),
102
- backgroundColor: chosen ? colors.selected : fill, onMouseDown };
103
+ return { text: (value * 100).toFixed(1), color: chosen ? (selectionFill.lit ? colors.selectedText : selectionFill.ink(colors.textBright)) : surfaceTextColor(fill),
104
+ backgroundColor: chosen ? selectionFill.bg : fill, onMouseDown };
103
105
  }} emptyStateTitle="No volatility observations." />
104
106
  <Box flexDirection="row" height={1} gap={1} paddingX={1} flexShrink={0} data-gloom-role="surface-legend">
105
107
  <Box flexShrink={0}><Text fg={colors.textDim}>{first?.label ?? ""}</Text></Box>
@@ -12,6 +12,7 @@ import { useShortcut } from "../../../react/input";
12
12
  import { usePaneSettingValue, usePluginAppActions, usePluginPaneState } from "../../../public/react";
13
13
  import { blendHex } from "../../../theme/color-utils";
14
14
  import { useThemeColors } from "../../../theme/theme-context";
15
+ import { useSelectionFill } from "../../../components/ui/selection-fill";
15
16
  import type { PaneProps } from "../../../types/plugin";
16
17
  import { Box, useUiCapabilities, type ScrollBoxRenderable } from "../../../ui";
17
18
  import { FILL_REST } from "../../../components/ui/fill";
@@ -84,6 +85,8 @@ type Axis = "spot" | "forward" | "delta" | "strike";
84
85
 
85
86
  export function VolSurfacePane({ focused, width, height }: PaneProps) {
86
87
  const colors = useThemeColors();
88
+ // The chosen cell is the table's cursor: quieter while the pane does not have the keys.
89
+ const selectionFill = useSelectionFill();
87
90
  const { symbol, ticker, financials } = usePaneTicker();
88
91
  const { createPaneFromTemplate } = usePluginAppActions();
89
92
  const target = resolveOptionsTarget(ticker);
@@ -511,8 +514,8 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
511
514
  if (column.id === "tenor") return { text: tenorLabel(row), color: colors.textDim };
512
515
  const index = Number(column.id), cell = row.cells[index]!;
513
516
  const chosen = row.label === tableSelectedRow?.label && index === tableCellIndex;
514
- return { text: formatIv(cell.volatility), color: chosen ? colors.selectedText : colors.textBright,
515
- backgroundColor: chosen ? colors.selected : cell.volatility == null ? colors.bg : blendHex(colors.bg, cell.volatility > 0.5 ? colors.warning : colors.positive, Math.min(0.48, 0.08 + cell.volatility * 0.5)),
517
+ return { text: formatIv(cell.volatility), color: chosen ? (selectionFill.lit ? colors.selectedText : selectionFill.ink(colors.textBright)) : colors.textBright,
518
+ backgroundColor: chosen ? selectionFill.bg : cell.volatility == null ? colors.bg : blendHex(colors.bg, cell.volatility > 0.5 ? colors.warning : colors.positive, Math.min(0.48, 0.08 + cell.volatility * 0.5)),
516
519
  onMouseDown: () => { onSelectRow(row); setCoordinate(cell.coordinate); } };
517
520
  }} emptyStateTitle="No volatility observations." />;
518
521
  const reopen = !shownDate && closedUnfitted ? usOptionsReopen(Date.now()) : null;
@@ -15,6 +15,7 @@ export {
15
15
  setPluginPaneStateValue,
16
16
  useDebouncedPluginPaneState,
17
17
  usePluginConfigState,
18
+ usePluginPaneChoice,
18
19
  usePluginPaneState,
19
20
  usePluginState,
20
21
  usePrunePluginPaneState,
@@ -17,6 +17,7 @@ import { usePluginRenderContext } from "./context";
17
17
  const DEFAULT_PLUGIN_PANE_STATE_COMMIT_DELAY_MS = 300;
18
18
 
19
19
  import { deletePluginPaneStateValue, getPluginPaneStateValue } from "../../layout/pane-state";
20
+ import { isPaneChoice, pluginChoiceKey } from "../../core/state/app/pane-choices";
20
21
  export { deletePluginPaneStateValue, getPluginPaneStateValue, setPluginPaneStateValue } from "../../layout/pane-state";
21
22
 
22
23
  /**
@@ -84,6 +85,25 @@ export function usePluginPaneState<T>(key: string, fallback: T, paneId?: string)
84
85
  return [value, setValue];
85
86
  }
86
87
 
88
+ /**
89
+ * Whether this plugin's pane-state `key` was chosen in this session rather
90
+ * than restored with the workspace, and the call for a pick that may leave the
91
+ * value as it is (see `pane-choices.ts`). Any write of the key already counts.
92
+ */
93
+ export function usePluginPaneChoice(key: string, paneId?: string): [chosen: boolean, choose: () => void] {
94
+ const { pluginId } = usePluginRenderContext();
95
+ const contextPaneId = useOptionalPaneInstanceId();
96
+ const scopedPaneId = paneId ?? contextPaneId;
97
+ if (!scopedPaneId) throw new Error("usePluginPaneChoice requires a pane id or PaneInstanceProvider");
98
+ const dispatch = useAppDispatch();
99
+ const choiceKey = pluginChoiceKey(pluginId, key);
100
+ const chosen = useAppSelector((state) => isPaneChoice(state, scopedPaneId, choiceKey));
101
+ const choose = useCallback(() => {
102
+ dispatch({ type: "CHOOSE_PANE_STATE", paneId: scopedPaneId, key: choiceKey });
103
+ }, [choiceKey, dispatch, scopedPaneId]);
104
+ return [chosen, choose];
105
+ }
106
+
87
107
  export function useDebouncedPluginPaneState<T>(
88
108
  key: string,
89
109
  fallback: T,
@@ -398,6 +398,9 @@ function headlineChangePercent(
398
398
  return quote ? (getCompletedRegularSessionDisplay(quote) ?? quote).changePercent : undefined;
399
399
  }
400
400
 
401
+ /** The 52W% cell's muted mark for a range read from the stored daily bars (Quote.yearRangeBasis). */
402
+ export const RANGE_FROM_BARS_NOTE = "bars";
403
+
401
404
  function fiftyTwoWeekPosition(displayQuote: ActiveQuoteDisplay | null, quote: TickerFinancials["quote"]): number | null {
402
405
  const range = displayQuote ? liveFiftyTwoWeekRange(quote, displayQuote.price) : null;
403
406
  return displayQuote && range ? ((displayQuote.price - range.low) / (range.high - range.low)) * 100 : null;
@@ -560,7 +563,7 @@ export function getColumnValue(
560
563
  ticker: TickerRecord,
561
564
  financials: TickerFinancials | undefined,
562
565
  ctx: ColumnContext,
563
- ): { text: string; color?: string; value?: number | string | null; valueUnit?: string; pnlBasis?: PortfolioPositionPnl["basis"] } {
566
+ ): { text: string; note?: string; color?: string; value?: number | string | null; valueUnit?: string; pnlBasis?: PortfolioPositionPnl["basis"] } {
564
567
  const sent = financials?.quote;
565
568
 
566
569
  const fundamentals = financials?.fundamentals;
@@ -679,7 +682,10 @@ export function getColumnValue(
679
682
  }
680
683
  case "range_52w": {
681
684
  const position = fiftyTwoWeekPosition(displayQuote, quote);
682
- return { text: position == null ? "—" : formatPercentRaw(Math.max(0, Math.min(100, position))) };
685
+ if (position == null) return { text: "—" };
686
+ // A range the service read from the stored daily bars, the source's being no year's, says so as the ticker pane does.
687
+ return { text: formatPercentRaw(Math.max(0, Math.min(100, position))),
688
+ ...(quote?.yearRangeBasis === "daily-bars" ? { note: RANGE_FROM_BARS_NOTE } : {}) };
683
689
  }
684
690
  case "market_cap": {
685
691
  const cap = liveMarketCapitalization(quote, fundamentals);
@@ -258,8 +258,10 @@ exports[`the runtime exports of every public subpath are the reviewed ones 1`] =
258
258
  "ConnectionHealthRegistry",
259
259
  "DEFAULT_MAX_READ_IDS",
260
260
  "PaneInstanceProvider",
261
+ "countEscapeTowardClose",
261
262
  "deletePluginPaneStateValue",
262
263
  "getPluginPaneStateValue",
264
+ "keepEscapeFromClosing",
263
265
  "markPersistedReadId",
264
266
  "normalizePersistedReadIdState",
265
267
  "resolveTickerForPane",
@@ -290,6 +292,7 @@ exports[`the runtime exports of every public subpath are the reviewed ones 1`] =
290
292
  "usePaneTicker",
291
293
  "usePaneTickerIdentity",
292
294
  "usePaneTitle",
295
+ "usePaneUnsentWork",
293
296
  "usePaneVisible",
294
297
  "usePersistedReadIds",
295
298
  "usePluginAppActions",
@@ -373,6 +376,8 @@ exports[`the runtime exports of every public subpath are the reviewed ones 1`] =
373
376
  "getThemeColors",
374
377
  "hoverBg",
375
378
  "hoverText",
379
+ "inactiveSelectedBg",
380
+ "inactiveSelectedText",
376
381
  "paneBg",
377
382
  "paneTitleBg",
378
383
  "paneTitleText",
@@ -72,6 +72,13 @@ export type { PaneTickerIdentity } from "./pane-hooks";
72
72
  // Keyboard handling for plugin panes; the renderer decides how events arrive.
73
73
  export { useShortcut } from "../react/input";
74
74
 
75
+ // What a pane's Esc does to the close (see Esc in docs/pane-conventions.md):
76
+ // an Esc that closes a menu of the pane's own is kept from closing the pane,
77
+ // an Esc that leaves an empty field counts toward it, and a pane holding a
78
+ // draft or an answer still coming in is never closed by Esc at all.
79
+ export { countEscapeTowardClose, keepEscapeFromClosing } from "../utils/double-escape-close";
80
+ export { usePaneUnsentWork } from "../state/pane-unsent-work";
81
+
75
82
  // The size of the surface the app is drawing into. A pane that pages or
76
83
  // virtualizes its own rows needs it, and it has to come from the renderer:
77
84
  // terminal cells, desktop pixels, and a browser tab are all different.
@@ -36,6 +36,35 @@ export function useAgeClock(since: number | null): number {
36
36
  return now;
37
37
  }
38
38
 
39
+ const UTC_DAY_MS = 86_400_000;
40
+
41
+ /**
42
+ * Today's UTC date (`2026-11-12`), which moves at each UTC midnight while the
43
+ * pane can be seen and catches up when it can. A footer that leaves the day
44
+ * off a time of today (`Gloom Cloud · 12:25 UTC`) reads it again with this
45
+ * among its inputs, so a pane left open overnight names the day
46
+ * (`Thu 12 Nov 12:25 UTC`).
47
+ */
48
+ export function useUtcDay(): string {
49
+ const visible = usePaneVisible();
50
+ const [clock, setClock] = useState(() => Date.now());
51
+ const day = new Date(clock).toISOString().slice(0, 10);
52
+
53
+ useEffect(() => {
54
+ if (!visible) return;
55
+ const now = Date.now();
56
+ if (new Date(now).toISOString().slice(0, 10) !== day) {
57
+ setClock(now);
58
+ return;
59
+ }
60
+ // A timer that fires a moment early sets the same day, and this runs again for the next.
61
+ const timer = setTimeout(() => setClock(Date.now()), UTC_DAY_MS - (now % UTC_DAY_MS) + 1_000);
62
+ return () => clearTimeout(timer);
63
+ }, [clock, day, visible]);
64
+
65
+ return day;
66
+ }
67
+
39
68
  export interface AutoRefreshOptions {
40
69
  /**
41
70
  * Cadence for a pane whose data moves faster than research data, such as a
@@ -19,15 +19,34 @@ function consumeHandoffParams(search: string, keys: string[]): void {
19
19
  history.replaceState(history.state, "", url);
20
20
  }
21
21
 
22
- export function createBrowserDeepLinkBridge(): DesktopDeepLinkBridge {
22
+ /** How this page was opened: "navigate", "reload" or "back_forward". */
23
+ function pageNavigationType(): string | undefined {
24
+ try {
25
+ const [entry] = globalThis.performance?.getEntriesByType?.("navigation") ?? [];
26
+ return (entry as PerformanceNavigationTiming | undefined)?.type;
27
+ } catch {
28
+ // Intentional ignore: without the timing API the page counts as opened from its address.
29
+ return undefined;
30
+ }
31
+ }
32
+
33
+ export function createBrowserDeepLinkBridge(navigationType: () => string | undefined = pageNavigationType): DesktopDeepLinkBridge {
23
34
  // Restoring a saved pane can update the address before App subscribes.
24
35
  // Keep the incoming link intact until it has been delivered once.
25
36
  const initialSearch = window.location.search;
37
+ // A reload, or a return through history, brings back the saved workspace the
38
+ // address was written from. Its tab asks for nothing: the pane keeps the tab
39
+ // it saved, and one only Pro opens stays behind a free one (pane-choices.ts).
40
+ const restoring = (() => {
41
+ const type = navigationType();
42
+ return type === "reload" || type === "back_forward";
43
+ })();
26
44
  return {
27
45
  subscribe(listener) {
28
46
  let initial = true;
29
47
  const emit = () => {
30
- const search = initial ? initialSearch : window.location.search;
48
+ const first = initial;
49
+ const search = first ? initialSearch : window.location.search;
31
50
  initial = false;
32
51
  const layoutId = marketplaceLayoutIdFromSearch(search);
33
52
  if (layoutId) {
@@ -49,7 +68,9 @@ export function createBrowserDeepLinkBridge(): DesktopDeepLinkBridge {
49
68
  return;
50
69
  }
51
70
  const entry = researchEntryFromSearch(search);
52
- if (entry) listener({ url: `gloomberb://ticker/${encodeURIComponent(entry.symbol)}?tab=${entry.tab}` });
71
+ if (!entry) return;
72
+ const symbolUrl = `gloomberb://ticker/${encodeURIComponent(entry.symbol)}`;
73
+ listener({ url: restoring && first ? symbolUrl : `${symbolUrl}?tab=${entry.tab}` });
53
74
  };
54
75
  emit();
55
76
  window.addEventListener("popstate", emit);