gloomberb 0.20.13 → 0.20.16

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 (275) hide show
  1. package/package.json +2 -1
  2. package/patches/@opentui%2Fcore@0.3.2.patch +22 -4
  3. package/src/account/auth-dialog.tsx +22 -4
  4. package/src/account/auth-form.tsx +6 -1
  5. package/src/account/checkout-handoff.tsx +7 -14
  6. package/src/account/device-signin-dialog.tsx +35 -24
  7. package/src/api-client/crypto-markets.ts +10 -0
  8. package/src/api-client/errors.ts +3 -1
  9. package/src/api-client/index.ts +54 -0
  10. package/src/api-client/install-experiments.ts +8 -7
  11. package/src/api-client/money-markets.ts +7 -0
  12. package/src/api-client/paths.ts +2 -1
  13. package/src/api-client/product-waitlist.ts +63 -0
  14. package/src/api-client/request.ts +16 -4
  15. package/src/api-client/types/billing.ts +45 -0
  16. package/src/api-client/yearly-plan.ts +132 -0
  17. package/src/app/global-shortcuts.ts +5 -3
  18. package/src/app/pane-runtime/index.tsx +2 -2
  19. package/src/app/pane-runtime/plugin-bindings.ts +3 -1
  20. package/src/app/pane-runtime/ticker-open-runtime.ts +6 -1
  21. package/src/app/since-last-visit/keys.ts +26 -0
  22. package/src/app/since-last-visit/model.ts +266 -0
  23. package/src/app/since-last-visit/strip.tsx +193 -0
  24. package/src/app/since-last-visit/use-since-last-visit.ts +289 -0
  25. package/src/app/since-last-visit/visit-tracker.ts +191 -0
  26. package/src/app.tsx +15 -0
  27. package/src/architecture/floating-promise-allowlist.json +0 -1
  28. package/src/brokers/signed-in/sign-in-dialog.tsx +38 -38
  29. package/src/cli/commands/market.ts +103 -27
  30. package/src/cli/commands/overview.ts +18 -4
  31. package/src/cli/commands/system.ts +29 -1
  32. package/src/cli/commands/ticker.ts +12 -5
  33. package/src/cli/desktop-pane-shot-api-policy.ts +4 -1
  34. package/src/cli/desktop-pane-shot-browser.ts +2 -1
  35. package/src/cli/desktop-pane-shot-view.ts +3 -7
  36. package/src/cli/desktop-pane-shot.ts +26 -28
  37. package/src/cli/errors.ts +3 -1
  38. package/src/cli/freshness.ts +7 -2
  39. package/src/cli/glossary.ts +10 -5
  40. package/src/cli/help.ts +1 -0
  41. package/src/cli/helpers.ts +8 -16
  42. package/src/cli/history-export.ts +4 -0
  43. package/src/cli/history-rows.ts +24 -0
  44. package/src/cli/index.ts +4 -0
  45. package/src/cli/known-gaps.ts +2 -2
  46. package/src/cli/listing-arg.ts +79 -11
  47. package/src/cli/not-a-ticker.ts +4 -0
  48. package/src/cli/options.ts +29 -1
  49. package/src/cli/pane-functions/catalog.ts +70 -12
  50. package/src/cli/pane-functions/function-help.ts +1 -1
  51. package/src/cli/pane-functions/headless.ts +68 -3
  52. package/src/cli/pane-functions/index.ts +2 -2
  53. package/src/cli/pane-functions/options.ts +7 -0
  54. package/src/cli/pane-functions/resolver.ts +104 -15
  55. package/src/cli/pane-functions/screenshot-payload.ts +3 -0
  56. package/src/cli/report-tables.ts +20 -5
  57. package/src/cli/result.ts +22 -4
  58. package/src/cli/shot-temp-dir.ts +30 -0
  59. package/src/cli/suffixed-listing-rows.ts +11 -0
  60. package/src/cli/symbol-args.ts +5 -3
  61. package/src/cli/symbol-list.ts +23 -10
  62. package/src/cli/symbol-rows.ts +135 -3
  63. package/src/cli/treasury-yields.ts +15 -1
  64. package/src/components/chart/composite/composite-chart.tsx +3 -3
  65. package/src/components/chart/composite/format.ts +2 -1
  66. package/src/components/chart/composite/panel-surface/axis-markers.ts +133 -0
  67. package/src/components/chart/composite/panel-surface/level-labels.tsx +78 -0
  68. package/src/components/chart/composite/panel-surface/overlays.ts +108 -0
  69. package/src/components/chart/composite/panel-surface/pan-coast.ts +54 -0
  70. package/src/components/chart/composite/panel-surface/panel-cursor.tsx +138 -0
  71. package/src/components/chart/composite/panel-surface/panel-levels.ts +47 -0
  72. package/src/components/chart/composite/panel-surface/plot-gestures.ts +403 -0
  73. package/src/components/chart/composite/panel-surface/plot-pointer.ts +65 -0
  74. package/src/components/chart/composite/panel-surface/plot-wheel.ts +102 -0
  75. package/src/components/chart/composite/panel-surface/pointer.ts +12 -0
  76. package/src/components/chart/composite/panel-surface/props.ts +79 -0
  77. package/src/components/chart/composite/panel-surface/tool-readout.ts +151 -0
  78. package/src/components/chart/composite/panel-surface/value-axis-gestures.ts +152 -0
  79. package/src/components/chart/composite/panel-surface.tsx +81 -1177
  80. package/src/components/command-bar/commands/collection-list.ts +1 -0
  81. package/src/components/command-bar/commands/direct/index.ts +31 -8
  82. package/src/components/command-bar/commands/registry.ts +7 -0
  83. package/src/components/command-bar/routes/root/command-items.ts +8 -0
  84. package/src/components/command-bar/routes/root/results.ts +19 -2
  85. package/src/components/command-bar/routes/root/runtime.ts +3 -2
  86. package/src/components/command-bar/routes/root/selection.ts +3 -2
  87. package/src/components/command-bar/routes/root/shortcuts.ts +15 -0
  88. package/src/components/company-logo.tsx +10 -3
  89. package/src/components/data-table/sections.ts +6 -1
  90. package/src/components/layout/pane/title.ts +16 -6
  91. package/src/components/layout/shell/index.tsx +5 -1
  92. package/src/components/layout/shell/ticker-link-menu.ts +12 -9
  93. package/src/components/pane-settings-dialog/tui.tsx +6 -3
  94. package/src/components/pane-settings-dialog.tsx +2 -1
  95. package/src/components/pane-template-wizard.tsx +2 -0
  96. package/src/components/ticker/badge/format.ts +12 -3
  97. package/src/components/ticker/badge/index.tsx +9 -3
  98. package/src/components/ticker/list-table-view.tsx +119 -17
  99. package/src/components/ui/choice-dialog.tsx +1 -1
  100. package/src/components/ui/confirm-dialog.tsx +3 -2
  101. package/src/components/ui/data-table/display-columns.ts +16 -0
  102. package/src/components/ui/data-table/index.tsx +40 -9
  103. package/src/components/ui/data-table/types.ts +14 -0
  104. package/src/components/ui/frame.tsx +7 -3
  105. package/src/components/ui/icon.tsx +4 -2
  106. package/src/components/ui/list-view.tsx +8 -0
  107. package/src/components/ui/number-prompt-dialog.tsx +2 -1
  108. package/src/components/use-pane-notice-footer.tsx +3 -1
  109. package/src/core/state/app/layout-reducer.ts +3 -1
  110. package/src/core/state/app/layout.ts +2 -2
  111. package/src/data/config/layout.ts +14 -0
  112. package/src/data/config/store/normalize.ts +11 -1
  113. package/src/docs/snapshot.json +2 -2
  114. package/src/i18n/es.ts +39 -0
  115. package/src/i18n/ja.ts +39 -0
  116. package/src/i18n/ko.ts +39 -0
  117. package/src/i18n/zh-cn.ts +39 -0
  118. package/src/i18n/zh-tw.ts +39 -0
  119. package/src/layout/pane-follow.ts +141 -4
  120. package/src/layout/pane-layout-move.ts +10 -7
  121. package/src/layout/ticker-navigation.ts +13 -19
  122. package/src/layout/ticker-retarget.ts +3 -2
  123. package/src/market-data/market/format.ts +35 -1
  124. package/src/market-data/market/index-level.ts +19 -0
  125. package/src/market-data/quotes/contributions.ts +13 -0
  126. package/src/market-data/quotes/export-identity.ts +36 -1
  127. package/src/market-data/quotes/resolution.ts +16 -0
  128. package/src/plugins/builtin/account-management/keyboard.ts +14 -0
  129. package/src/plugins/builtin/account-management/model.ts +2 -0
  130. package/src/plugins/builtin/account-management/pane.tsx +79 -7
  131. package/src/plugins/builtin/account-management/password-dialog.tsx +2 -2
  132. package/src/plugins/builtin/account-management/payment-recovery-row.tsx +97 -0
  133. package/src/plugins/builtin/account-management/yearly-plan-row.tsx +359 -0
  134. package/src/plugins/builtin/analytics/risk-client.ts +12 -2
  135. package/src/plugins/builtin/analytics/risk-headless.ts +66 -6
  136. package/src/plugins/builtin/analytics/risk-math.ts +23 -6
  137. package/src/plugins/builtin/analytics/risk-model.ts +20 -9
  138. package/src/plugins/builtin/analytics/risk-pane.tsx +2 -2
  139. package/src/plugins/builtin/awards/pane.tsx +6 -8
  140. package/src/plugins/builtin/changelog/index.tsx +6 -44
  141. package/src/plugins/builtin/changelog/versions.ts +17 -68
  142. package/src/plugins/builtin/chart-composer/catalog-inventory.ts +5 -2
  143. package/src/plugins/builtin/chart-composer/editor.tsx +1 -0
  144. package/src/plugins/builtin/chart-composer/pane.tsx +1 -1
  145. package/src/plugins/builtin/chart-composer/quick-add.tsx +4 -1
  146. package/src/plugins/builtin/chart-composer/series-catalog.ts +17 -1
  147. package/src/plugins/builtin/cloud/askg/executor.ts +2 -1
  148. package/src/plugins/builtin/cloud/askg/sources.ts +2 -1
  149. package/src/plugins/builtin/cloud/plugin.tsx +2 -0
  150. package/src/plugins/builtin/cloud/thesis/module.tsx +2 -0
  151. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +6 -2
  152. package/src/plugins/builtin/cpi/headless.ts +6 -1
  153. package/src/plugins/builtin/cpi/model.ts +17 -0
  154. package/src/plugins/builtin/cpi/pane.tsx +4 -2
  155. package/src/plugins/builtin/crypto-board/client.ts +6 -1
  156. package/src/plugins/builtin/crypto-board/headless.ts +10 -2
  157. package/src/plugins/builtin/crypto-board/model.ts +89 -11
  158. package/src/plugins/builtin/crypto-board/pane.tsx +20 -5
  159. package/src/plugins/builtin/debt-maturities/model.ts +1 -1
  160. package/src/plugins/builtin/dividend-yield/client.ts +24 -2
  161. package/src/plugins/builtin/dividend-yield/headless.ts +4 -2
  162. package/src/plugins/builtin/dividend-yield/ranking.ts +2 -1
  163. package/src/plugins/builtin/dividend-yield/view.ts +5 -1
  164. package/src/plugins/builtin/earnings/board-table.ts +1 -1
  165. package/src/plugins/builtin/earnings/board.tsx +36 -16
  166. package/src/plugins/builtin/earnings/highlight.ts +47 -0
  167. package/src/plugins/builtin/earnings/history-table.ts +9 -1
  168. package/src/plugins/builtin/earnings/index.tsx +1 -1
  169. package/src/plugins/builtin/earnings-calls/pane.tsx +2 -2
  170. package/src/plugins/builtin/earnings-ripple/index.tsx +2 -0
  171. package/src/plugins/builtin/econ/calendar-model.ts +17 -1
  172. package/src/plugins/builtin/econ/fred-catalog.ts +33 -4
  173. package/src/plugins/builtin/econ-statistics/headless.ts +21 -0
  174. package/src/plugins/builtin/estimate-revisions/model.ts +1 -1
  175. package/src/plugins/builtin/exposure/index.tsx +1 -1
  176. package/src/plugins/builtin/macro-day/headless.ts +21 -10
  177. package/src/plugins/builtin/macro-day/model.ts +42 -3
  178. package/src/plugins/builtin/macro-day/pane.tsx +26 -8
  179. package/src/plugins/builtin/macro-day/releases.ts +24 -1
  180. package/src/plugins/builtin/market-valuation/detail.tsx +3 -3
  181. package/src/plugins/builtin/market-valuation/headless.ts +11 -4
  182. package/src/plugins/builtin/market-valuation/pane.tsx +3 -1
  183. package/src/plugins/builtin/market-valuation/view.ts +14 -0
  184. package/src/plugins/builtin/money-markets/client.ts +4 -1
  185. package/src/plugins/builtin/money-markets/headless.ts +15 -4
  186. package/src/plugins/builtin/money-markets/index.tsx +1 -1
  187. package/src/plugins/builtin/money-markets/pane.tsx +7 -1
  188. package/src/plugins/builtin/news/wire/news/detail-view.tsx +20 -8
  189. package/src/plugins/builtin/pe-band/pane.tsx +1 -1
  190. package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -2
  191. package/src/plugins/builtin/portfolio-list/cli/period-report.ts +61 -11
  192. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +11 -3
  193. package/src/plugins/builtin/portfolio-list/cli/render.ts +8 -1
  194. package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +178 -17
  195. package/src/plugins/builtin/portfolio-list/headless.ts +33 -6
  196. package/src/plugins/builtin/portfolio-list/pane/groups.tsx +220 -0
  197. package/src/plugins/builtin/portfolio-list/pane/index.tsx +95 -18
  198. package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +24 -6
  199. package/src/plugins/builtin/portfolio-list/period-pnl.ts +16 -1
  200. package/src/plugins/builtin/portfolio-list/summary/index.tsx +4 -1
  201. package/src/plugins/builtin/portfolio-list/summary/totals.ts +6 -4
  202. package/src/plugins/builtin/portfolio-list/table.tsx +38 -16
  203. package/src/plugins/builtin/research/corporate-actions-pane.tsx +4 -2
  204. package/src/plugins/builtin/research/relative-valuation-headless.ts +15 -5
  205. package/src/plugins/builtin/research/relative-valuation-model.ts +7 -1
  206. package/src/plugins/builtin/research/relative-valuation-pane.tsx +7 -4
  207. package/src/plugins/builtin/shared/cloud-upgrade.ts +4 -2
  208. package/src/plugins/builtin/shared/cpi-year-gap.ts +67 -0
  209. package/src/plugins/builtin/shared/headless-options.ts +1 -1
  210. package/src/plugins/builtin/social-mentions/model.ts +2 -2
  211. package/src/plugins/builtin/thirteenf/pane.tsx +1 -1
  212. package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +45 -2
  213. package/src/plugins/builtin/ticker-detail/financials/model.ts +51 -16
  214. package/src/plugins/builtin/ticker-detail/financials/nopat.ts +16 -0
  215. package/src/plugins/builtin/ticker-detail/financials/ratios.ts +44 -13
  216. package/src/plugins/builtin/ticker-detail/financials/schema.ts +33 -2
  217. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +4 -2
  218. package/src/plugins/builtin/ticker-detail/headless-schema.ts +30 -4
  219. package/src/plugins/builtin/ticker-detail/headless.ts +280 -35
  220. package/src/plugins/builtin/ticker-detail/overview/components.tsx +4 -5
  221. package/src/plugins/builtin/ticker-detail/overview/model.ts +9 -2
  222. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +10 -2
  223. package/src/plugins/builtin/ticker-detail/pharma-signals/eligibility.ts +32 -0
  224. package/src/plugins/builtin/ticker-detail/pharma-signals/tab.tsx +162 -0
  225. package/src/plugins/builtin/ticker-detail/pharma-signals/waitlist.ts +126 -0
  226. package/src/plugins/builtin/ticker-detail/research-groups.ts +6 -4
  227. package/src/plugins/builtin/ticker-detail/research-tabs.ts +11 -0
  228. package/src/portfolio/collection-name.ts +2 -1
  229. package/src/portfolio/column-values.ts +34 -12
  230. package/src/portfolio/listed-symbol.ts +4 -2
  231. package/src/portfolio/period-pnl.ts +51 -1
  232. package/src/portfolio/suffixed-listings.ts +3 -1
  233. package/src/portfolio/watchlist-groups.ts +212 -0
  234. package/src/react/ticker-source.ts +3 -1
  235. package/src/renderers/dom/dialog-host.tsx +5 -5
  236. package/src/renderers/dom/styles.css +7 -0
  237. package/src/renderers/electrobun/view/remote/capability-invoker.ts +1 -1
  238. package/src/renderers/opentui/dialog-host.tsx +3 -4
  239. package/src/sources/gloomberb-cloud/normalizers.ts +5 -0
  240. package/src/sources/provider-router/history.ts +5 -2
  241. package/src/state/app/bootstrap.ts +11 -0
  242. package/src/state/app/context/index.tsx +6 -0
  243. package/src/sync/collections-contributor.ts +5 -2
  244. package/src/sync/config-merge.ts +10 -2
  245. package/src/sync/sanitize.ts +28 -0
  246. package/src/telemetry/usage-counts.ts +17 -0
  247. package/src/test-support/plugin-persistence.ts +12 -0
  248. package/src/tickers/company-name-listing.ts +4 -3
  249. package/src/tickers/company-name.ts +19 -1
  250. package/src/tickers/instrument-coverage.ts +27 -0
  251. package/src/tickers/search/home-listing.ts +38 -1
  252. package/src/tickers/search/index.ts +3 -2
  253. package/src/tickers/search/ranking.ts +21 -2
  254. package/src/time-series/base-series.ts +4 -0
  255. package/src/time-series/chart-seed.ts +1 -1
  256. package/src/time-series/financial-period-coverage.ts +4 -12
  257. package/src/time-series/parsed-history-cache.ts +1 -1
  258. package/src/time-series/resolve.ts +1 -1
  259. package/src/time-series/types.ts +5 -2
  260. package/src/time-series/use-chart-resolution.ts +6 -1
  261. package/src/types/config.ts +32 -0
  262. package/src/types/financials.ts +13 -0
  263. package/src/types/headless.ts +7 -0
  264. package/src/types/plugin-context.ts +5 -0
  265. package/src/types/ticker.ts +14 -0
  266. package/src/ui/ascii-font.ts +1 -4
  267. package/src/ui/dialog-stack.ts +17 -0
  268. package/src/ui/dialog.tsx +6 -2
  269. package/src/utils/async-deadline.ts +2 -2
  270. package/src/utils/crypto-pair.ts +9 -0
  271. package/src/utils/csv.ts +44 -5
  272. package/src/utils/exchanges.ts +13 -0
  273. package/src/utils/financial-statements.ts +60 -3
  274. package/src/utils/futures-generic.ts +17 -0
  275. package/src/utils/trailing-dividend.ts +13 -3
@@ -328,6 +328,7 @@ export async function addPastedListToWatchlist(options: {
328
328
  ),
329
329
  // A saved alias of a holding is the holding's own record, as for the single add.
330
330
  add: (ticker) => withCollectionMembership(resolveCollectionTicker(ticker, deps.getState().tickers, "watchlist", targetId), "watchlist", "add", targetId),
331
+ member: (ticker) => ticker.metadata.watchlists.includes(targetId),
331
332
  });
332
333
 
333
334
  for (const ticker of saved) {
@@ -244,14 +244,26 @@ export function runDirectCommandAction(options: {
244
244
  return;
245
245
  case "export-config": {
246
246
  const exportPath = getDefaultConfigBackupPath();
247
- void exportConfig(state.config, exportPath)
248
- .then(() => {
249
- notify(`Config exported to ${exportPath}`, { type: "success" });
250
- closeAll({ revertThemePreview: false });
251
- })
252
- .catch((error) => {
253
- notify(error instanceof Error ? error.message : "Export failed.", { type: "error" });
254
- });
247
+ // A file written to the home folder, over any copy there, says where before it is written: `config` and Enter
248
+ // once wrote it without a word.
249
+ openInlineConfirm({
250
+ confirmId: "export-config",
251
+ title: "Export Config",
252
+ body: [
253
+ `This saves your layouts, portfolios, watchlists, settings and recent commands to ${exportPath}, replacing any copy there.`,
254
+ ],
255
+ confirmLabel: "Export",
256
+ cancelLabel: "Back",
257
+ onConfirm: async () => {
258
+ try {
259
+ await exportConfig(getState().config, exportPath);
260
+ notify(`Config exported to ${exportPath}`, { type: "success" });
261
+ closeAll({ revertThemePreview: false });
262
+ } catch (error) {
263
+ notify(error instanceof Error ? error.message : "Export failed.", { type: "error" });
264
+ }
265
+ },
266
+ });
255
267
  return;
256
268
  }
257
269
  case "import-config": {
@@ -342,6 +354,17 @@ export function runDirectCommandAction(options: {
342
354
  closeAll({ revertThemePreview: false });
343
355
  return;
344
356
  }
357
+ case "toggle-since-last-visit": {
358
+ // Only off is saved; on is the default.
359
+ const { sinceLastVisit, ...rest } = state.config;
360
+ const enabled = sinceLastVisit === false;
361
+ const nextConfig: AppConfig = enabled ? rest : { ...rest, sinceLastVisit: false };
362
+ dispatch({ type: "SET_CONFIG", config: nextConfig });
363
+ persistConfig(nextConfig);
364
+ notify(`${t(command.label)}: ${t(enabled ? "on" : "off")}`, { type: "success" });
365
+ closeAll({ revertThemePreview: false });
366
+ return;
367
+ }
345
368
  case "toggle-crash-reports":
346
369
  case "toggle-usage-counts":
347
370
  case "toggle-attention-counts": {
@@ -255,6 +255,13 @@ export const commands: Command[] = [
255
255
  description: "Turn quote update flashing on or off",
256
256
  category: "Config",
257
257
  },
258
+ {
259
+ id: "toggle-since-last-visit",
260
+ prefix: "",
261
+ label: "Since Last Visit",
262
+ description: "Turn on or off the strip that shows what moved in your tickers since your last visit",
263
+ category: "Config",
264
+ },
258
265
  {
259
266
  id: "font-size-increase",
260
267
  prefix: "FONT+",
@@ -176,6 +176,10 @@ export function createRootCommandItemBuilder({
176
176
  return state.config.valueFlashingEnabled ? "Currently on" : "Currently off";
177
177
  case "toggle-presentation-mode":
178
178
  return state.config.presentationMode ? "Currently on" : "Currently off";
179
+ case "toggle-since-last-visit":
180
+ return state.config.sinceLastVisit === false
181
+ ? "Currently off"
182
+ : "Currently on: what moved in your tickers shows above the layout when you come back";
179
183
  case "toggle-crash-reports":
180
184
  return state.config.telemetry?.crashReports === false ? "Currently off" : "Currently on";
181
185
  case "toggle-usage-counts":
@@ -208,6 +212,8 @@ export function createRootCommandItemBuilder({
208
212
  return state.config.telemetry?.usage === false ? "off" : "on";
209
213
  case "toggle-attention-counts":
210
214
  return state.config.telemetry?.attention === false ? "off" : "on";
215
+ case "toggle-since-last-visit":
216
+ return state.config.sinceLastVisit === false ? "off" : "on";
211
217
  case "release-channel":
212
218
  return resolveUpdateChannel(state.config);
213
219
  default:
@@ -231,6 +237,8 @@ export function createRootCommandItemBuilder({
231
237
  return "nightly stable beta prerelease update updates channel";
232
238
  case "run-setup-again":
233
239
  return "settings onboarding wizard guide first run start over desks holdings";
240
+ case "toggle-since-last-visit":
241
+ return "settings return strip what changed moves since away recap welcome back";
234
242
  case "quit":
235
243
  return "quit exit";
236
244
  default:
@@ -18,7 +18,7 @@ import { isCollectionCommand, SECURITY_DESCRIPTION_SEARCH } from "../../helpers"
18
18
  import { recentPaneTemplateArg } from "../../pane-templates/items";
19
19
  import { dedupeById, PASTED_LIST_CATEGORY } from "../../view-model";
20
20
  import type { ResultItem } from "../../list/model";
21
- import { shortcutArgument, type parseRootShortcutIntent } from "./shortcuts";
21
+ import { commandShortcutQuery, shortcutArgument, type parseRootShortcutIntent } from "./shortcuts";
22
22
  import type { CommandBarRoute } from "../../workflow/types";
23
23
  import { createRootCommandItemBuilder } from "./command-items";
24
24
  import { buildRootShortcutItem } from "./shortcut-items";
@@ -173,6 +173,16 @@ function buildBindKeyItem(
173
173
  };
174
174
  }
175
175
 
176
+ /** Words a query asks for the app's settings with. */
177
+ const CONFIG_QUERY_WORDS = new Set(["config", "configuration", "preferences", "prefs"]);
178
+
179
+ /** The commands that open or change one of the app's settings, in the order a settings query lists them: choices first. */
180
+ const APP_SETTING_COMMAND_IDS = [
181
+ "theme", "language", "header-market", "release-channel", "cycle-chart-renderer", "toggle-value-flashing", "toggle-since-last-visit",
182
+ "toggle-status-bar", "toggle-presentation-mode", "font-size-increase", "font-size-decrease", "toggle-crash-reports",
183
+ "toggle-usage-counts", "toggle-attention-counts", "check-for-updates",
184
+ ];
185
+
176
186
  /**
177
187
  * Ranks a provider's in-memory rows with the local matches without reordering
178
188
  * them: the provider decided which rows answer and in what order, so the block
@@ -301,7 +311,8 @@ export function buildRootResultModel(options: RootResultModelOptions): RootResul
301
311
  });
302
312
 
303
313
  const items: ResultItem[] = [];
304
- const match = matchPrefix(rootQuery, availableCommands);
314
+ // A command typed after its ticker (`MC FP Equity DES`) lists as typed first (`DES MC:EPA`).
315
+ const match = matchPrefix(commandShortcutQuery(rootQuery, rootShortcutIntent), availableCommands);
305
316
  // A pasted list, which the bar flattens into one line, leads with adding its symbols. The AI is still offered.
306
317
  const pastedList = rootShortcutIntent.kind === "none" && !match && rootQuery ? pastedRootList(rootQuery) : null;
307
318
  let initialIdx = 0;
@@ -439,6 +450,12 @@ export function buildRootResultModel(options: RootResultModelOptions): RootResul
439
450
  ...pluginItems,
440
451
  ];
441
452
  if (pastedList) items.push(pastedListItem(pastedList, executeCollectionCommand));
453
+ // `config` asks for the app's settings: each one, a choice to open first, ahead of Export and Import Config,
454
+ // which its words match by name and which write or replace a whole file.
455
+ if (CONFIG_QUERY_WORDS.has(rootQuery.trim().toLowerCase())) {
456
+ const byId = new Map(commandItems.map((item) => [item.id, item]));
457
+ items.push(...APP_SETTING_COMMAND_IDS.flatMap((id) => byId.get(id) ?? []));
458
+ }
442
459
  items.push(...rankMatchBlock(allItems, providerMatchItems, rootQuery));
443
460
  }
444
461
 
@@ -17,7 +17,7 @@ import { buildRootResultModel, type RootResultModel } from "./results";
17
17
  import { useRootProviderSearch } from "./provider-search";
18
18
  import { isProviderResultItem } from "./search-providers";
19
19
  import { buildRootShortcutFeedback } from "./shortcut-feedback";
20
- import type { ShortcutIntent } from "./shortcuts";
20
+ import { commandShortcutQuery, type ShortcutIntent } from "./shortcuts";
21
21
  import { clampIndex } from "../../../../utils/math";
22
22
 
23
23
  /** Written the way a symbol is: up to five letters and a share class (AAPL, nvda, BRK.B). */
@@ -184,7 +184,8 @@ export function useCommandBarRootRuntime({
184
184
  */
185
185
  const pinnedRootRowRef = useRef<{ id: string; answer: string | null } | null>(null);
186
186
  const previousAnswerTookTopRef = useRef(0);
187
- const activeMatch = matchPrefix(rootQuery, availableCommands);
187
+ // `MC FP Equity DES` is `DES MC:EPA`, as `MC FP Equity GP` is `GP MC:EPA`.
188
+ const activeMatch = matchPrefix(commandShortcutQuery(rootQuery, rootShortcutIntent), availableCommands);
188
189
 
189
190
  const tickerSearchRouteQuery = currentRoute?.kind === "mode" && currentRoute.screen === "ticker-search"
190
191
  ? currentRoute.query
@@ -14,7 +14,7 @@ import {
14
14
  } from "../../helpers";
15
15
  import type { ResultItem } from "../../list/model";
16
16
  import { getPaneTemplateArgKind } from "../../pane-templates/items";
17
- import { parseRootShortcutIntent, shortcutArgument } from "./shortcuts";
17
+ import { commandShortcutQuery, parseRootShortcutIntent, shortcutArgument } from "./shortcuts";
18
18
  import { buildHelpArgumentItems } from "./help-items";
19
19
  import { recordFunctionOpen } from "../../../../telemetry/usage-counts";
20
20
 
@@ -127,7 +127,8 @@ export function buildImmediateRootSelection(options: RootSelectionCommandOptions
127
127
  });
128
128
  }
129
129
 
130
- const match = matchPrefix(options.query, options.availableCommands);
130
+ // `MC FP Equity DES` runs as `DES MC:EPA`, as `MC FP Equity GP` opens GP.
131
+ const match = matchPrefix(commandShortcutQuery(options.query, intent), options.availableCommands);
131
132
  if (!match) {
132
133
  return null;
133
134
  }
@@ -20,6 +20,8 @@ interface ShortcutIntentBase {
20
20
  completionQuery: string | null;
21
21
  /** The ticker in focus the argument was filled with, when none was typed. */
22
22
  inferredArg?: string;
23
+ /** Typed in Bloomberg's order, the ticker before the code (`MC FP Equity DES`). */
24
+ tickerFirst?: true;
23
25
  }
24
26
 
25
27
  interface CommandShortcutIntent extends ShortcutIntentBase {
@@ -43,6 +45,18 @@ export type ShortcutIntent =
43
45
  | PaneTemplateShortcutIntent
44
46
  | PluginCommandShortcutIntent;
45
47
 
48
+ /**
49
+ * The query a command runs as: one typed ticker first (`MC FP Equity DES`) in
50
+ * the code's own order (`DES MC:EPA`), so it lists, searches and opens on
51
+ * Enter as the code typed first does, as a pane's code typed after its ticker
52
+ * does (`MC FP Equity GP`). Any other query as typed.
53
+ */
54
+ export function commandShortcutQuery(query: string, intent: ShortcutIntent): string {
55
+ return intent.kind !== "none" && intent.source === "command" && intent.tickerFirst && intent.argText
56
+ ? `${intent.prefix} ${intent.argText}`
57
+ : query;
58
+ }
59
+
46
60
  interface ShortcutParseCandidate {
47
61
  prefix: string;
48
62
  label: string;
@@ -239,6 +253,7 @@ export function parseRootShortcutIntent({
239
253
  argText,
240
254
  completionQuery,
241
255
  ...(kind === "inferred-complete" && inferredArg && issuer ? { inferredArg } : {}),
256
+ ...(trimmed !== typed ? { tickerFirst: true as const } : {}),
242
257
  };
243
258
 
244
259
  if (match.source === "command" && match.command) {
@@ -8,6 +8,7 @@ import type { DataTableCell } from "./ui/data-table";
8
8
  import { LogoMark, type LogoMarkProps } from "./ui/logo-mark";
9
9
  import { canonicalExchange, canonicalTickerKey, isUsEquityExchange } from "../utils/exchanges";
10
10
  import { tickerHasListingSuffix } from "../sources/listing-symbols";
11
+ import { isRoundTheClockCoin } from "../utils/crypto-pair";
11
12
 
12
13
  /**
13
14
  * A company's listing as the logo service knows it: one abroad by its venue
@@ -26,7 +27,7 @@ export function resolveCompanyLogoSrc(input: {
26
27
  /** The listing's venue, so a symbol a US company also uses draws its own company's logo. */
27
28
  exchange?: string;
28
29
  }): string | null {
29
- const kind = logoKindForAsset(input.assetCategory);
30
+ const kind = logoKindForAsset(input.assetCategory, input.symbol, input.exchange);
30
31
  if (!kind) return null;
31
32
  const path = cloudLogoPath(kind, kind === "ticker" ? logoListing(input.symbol, input.exchange) : input.symbol);
32
33
  return path ? `${getCloudApiBaseUrl()}${path}` : null;
@@ -124,8 +125,14 @@ export function CompanyLogo({
124
125
  );
125
126
  }
126
127
 
127
- function logoKindForAsset(assetCategory?: string): CloudLogoKind | null {
128
+ /**
129
+ * A coin is asked for on the crypto path, never as a ticker. A listing opened
130
+ * from its quote keeps no type (BTC-USD on CCC from a board row or a link), so
131
+ * without one its listing says whether it is a coin: a bare BTC is a US fund.
132
+ */
133
+ function logoKindForAsset(assetCategory?: string, symbol?: string, exchange?: string): CloudLogoKind | null {
128
134
  const kind = resolveAssetDisplayKind({ assetCategory });
129
135
  if (kind === "cash" || kind === "contract") return null;
130
- return kind === "crypto" ? "crypto" : "ticker";
136
+ if (kind === "crypto") return "crypto";
137
+ return kind === "other" && isRoundTheClockCoin(symbol, exchange) ? "crypto" : "ticker";
131
138
  }
@@ -47,8 +47,13 @@ export function isSectionedItemRow<T>(row: SectionedRow<T>): row is { kind: "ite
47
47
  return row.kind === "item";
48
48
  }
49
49
 
50
+ /** A section header's text: its label and how many rows it holds, shown or collapsed. */
51
+ export function sectionHeaderText(label: string, count: number): string {
52
+ return `${label} (${count})`;
53
+ }
54
+
50
55
  export function renderSectionedRowHeader<T>(row: SectionedRow<T>): DataTableSectionHeader | null {
51
- return row.kind === "section" ? { text: `${row.label} (${row.count})` } : null;
56
+ return row.kind === "section" ? { text: sectionHeaderText(row.label, row.count) } : null;
52
57
  }
53
58
 
54
59
  /** Row count a section list needs when the table is embedded at a fixed height. */
@@ -6,10 +6,16 @@ import {
6
6
  type PaneInstanceConfig,
7
7
  } from "../../../types/config";
8
8
  import type { PaneDef } from "../../../types/plugin";
9
- import { paneTitleMnemonic, TITLE_TICKER } from "../../../layout/pane-follow";
9
+ import { isUnlinkedFollower, paneTitleMnemonic, TITLE_TICKER } from "../../../layout/pane-follow";
10
10
  import { canFollowTickerSource, isTickerLinkPeer } from "../../../layout/ticker-navigation";
11
+ import { withoutCryptoVenueCode } from "../../../utils/crypto-pair";
11
12
  import { displayTickerKey } from "../../../utils/exchanges";
12
13
 
14
+ /** A ticker as a title names it: by its venue's own code, and a coin by its pair alone (USDT-USD, never USDT-USD:CCC). */
15
+ function titleTickerKey(key: string): string {
16
+ return withoutCryptoVenueCode(displayTickerKey(key));
17
+ }
18
+
13
19
  /**
14
20
  * A title a template wrote, its command and the ticker keys it opened on
15
21
  * ("FA 9992:XHKG", "RV 9992:XHKG,PLTR"), with each key by its venue's code
@@ -22,7 +28,7 @@ function displayStoredTitle(title: string): string {
22
28
  const parts = title.slice(mnemonic.length).split(/(\s*,\s*)/);
23
29
  const keys = parts.filter((_, index) => index % 2 === 0).map((key) => key.trim());
24
30
  if (!keys[0] || !keys.every((key) => TITLE_TICKER.test(key))) return title;
25
- return `${title.slice(0, mnemonic.length)}${parts.map((part, index) => index % 2 === 0 ? part.replace(part.trim(), displayTickerKey(part.trim())) : part).join("")}`;
31
+ return `${title.slice(0, mnemonic.length)}${parts.map((part, index) => index % 2 === 0 ? part.replace(part.trim(), titleTickerKey(part.trim())) : part).join("")}`;
26
32
  }
27
33
 
28
34
  /** Single-cell link glyph: emoji link icons render double-width in terminals. */
@@ -48,7 +54,7 @@ export function getBasePaneDisplayTitle(
48
54
 
49
55
  if (instance.paneId === TICKER_RESEARCH_PANE_ID) {
50
56
  const ticker = resolveTickerForPane(state as AppState, instance.instanceId);
51
- if (ticker) return displayTickerKey(ticker);
57
+ if (ticker) return titleTickerKey(ticker);
52
58
  const collectionId = resolveCollectionForPane(state as AppState, instance.instanceId);
53
59
  return state.config.portfolios.find((portfolio) => portfolio.id === collectionId)?.name
54
60
  ?? state.config.watchlists.find((watchlist) => watchlist.id === collectionId)?.name
@@ -62,7 +68,7 @@ export function getBasePaneDisplayTitle(
62
68
  : null;
63
69
  if (mnemonic) {
64
70
  const ticker = resolveTickerForPane(state as AppState, instance.instanceId);
65
- return ticker ? `${mnemonic} ${displayTickerKey(ticker)}` : mnemonic;
71
+ return ticker ? `${mnemonic} ${titleTickerKey(ticker)}` : mnemonic;
66
72
  }
67
73
 
68
74
  if (instance.title) return displayStoredTitle(instance.title);
@@ -78,7 +84,7 @@ export function getBasePaneDisplayTitle(
78
84
  if (paneDef.tickerSource) return t(paneDef.name);
79
85
 
80
86
  const ticker = resolveTickerForPane(state as AppState, instance.instanceId);
81
- return ticker ? `${t(paneDef.name)}: ${displayTickerKey(ticker)}` : t(paneDef.name);
87
+ return ticker ? `${t(paneDef.name)}: ${titleTickerKey(ticker)}` : t(paneDef.name);
82
88
  }
83
89
 
84
90
  export function getPaneDisplayTitle(
@@ -88,9 +94,13 @@ export function getPaneDisplayTitle(
88
94
  panes?: ReadonlyMap<string, PaneDef>,
89
95
  ): string {
90
96
  const title = getBasePaneDisplayTitle(state, instance, paneDef, panes);
91
- if (instance.binding?.kind !== "follow" || !panes) return title;
97
+ if (!panes) return title;
92
98
  const research = instance.paneId === TICKER_RESEARCH_PANE_ID;
93
99
  if (!research && !canFollowTickerSource(instance, panes)) return title;
100
+ // A pane its link left (an unlink, its source closed, or another research pane took it) says
101
+ // so where it named the source, until it follows a pane again.
102
+ if (isUnlinkedFollower(instance)) return `${title} ${LINK_GLYPH} ${t("Unlinked")}`;
103
+ if (instance.binding?.kind !== "follow") return title;
94
104
 
95
105
  const source = findPaneInstance(state.config.layout, instance.binding.sourceInstanceId);
96
106
  const sourceDef = source ? panes.get(source.paneId) : null;
@@ -98,6 +98,8 @@ interface ShellProps {
98
98
  desktopWindowBridge?: DesktopWindowBridge;
99
99
  desktopDockPreview?: DesktopDockPreviewState | null;
100
100
  commandBarNativeOccluder?: LayoutBounds | null;
101
+ /** Rows of app chrome between the header and the layout (the since-last-visit strip). */
102
+ topBandRows?: number;
101
103
  }
102
104
 
103
105
  interface TransientFocusLayoutState {
@@ -114,6 +116,7 @@ export function Shell({
114
116
  desktopWindowBridge,
115
117
  desktopDockPreview,
116
118
  commandBarNativeOccluder = null,
119
+ topBandRows = 0,
117
120
  }: ShellProps) {
118
121
  const colors = useThemeColors();
119
122
  const dispatch = useAppDispatch();
@@ -143,7 +146,8 @@ export function Shell({
143
146
  const shellRef = useRef<BoxRenderable | null>(null);
144
147
 
145
148
  const chrome = useAppChromeShown();
146
- const appHeaderHeight = chrome.header ? resolveAppHeaderHeightCells({ titleBarOverlay, cellHeightPx }) : 0;
149
+ // Where the layout starts: the header, then any band of chrome under it.
150
+ const appHeaderHeight = (chrome.header ? resolveAppHeaderHeightCells({ titleBarOverlay, cellHeightPx }) : 0) + topBandRows;
147
151
  const contentHeight = Math.max(1, height - appHeaderHeight - (chrome.statusBar ? 1 : 0));
148
152
  pluginRegistry.bindHost({ getTermSize: () => ({ width, height: contentHeight }) });
149
153
 
@@ -2,13 +2,12 @@ import { tf } from "../../../i18n";
2
2
  import { updatePaneInstance } from "../../../pane-settings";
3
3
  import {
4
4
  canFollowTickerSource,
5
- followBindingReaches,
6
5
  isTickerLinkPeer,
7
6
  } from "../../../layout/ticker-navigation";
8
7
  import { isPaneInLayout } from "../../../layout/pane-manager";
9
8
  import { resolveTickerForPane, type AppState } from "../../../state/app/context";
10
9
  import { resolveInstrumentForPane } from "../../../core/state/app/instrument";
11
- import { paneTitleMnemonic, pinFollowingPane } from "../../../layout/pane-follow";
10
+ import { followBindingReaches, linkFollower, paneTitleMnemonic, pinFollowingPane } from "../../../layout/pane-follow";
12
11
  import {
13
12
  findPaneInstance,
14
13
  TICKER_RESEARCH_PANE_ID,
@@ -45,11 +44,15 @@ export function tickerLinkMenuItems({
45
44
  const linkable = research || canFollowTickerSource(instance, panes);
46
45
 
47
46
  const sourceInstanceId = instance.binding?.kind === "follow" ? instance.binding.sourceInstanceId : null;
47
+ const sourcePaneId = (id: string) => findPaneInstance(layout, id)?.paneId;
48
48
  const unlink = (symbol: string) => {
49
49
  const contract = resolveInstrumentForPane(state, instance.instanceId)?.instrument;
50
50
  persistLayout(updatePaneInstance(layout, instance.instanceId, (current) => {
51
51
  const mnemonic = research ? null : paneTitleMnemonic(current.title);
52
- return pinFollowingPane(mnemonic ? { ...current, title: mnemonic } : current, symbol, contract);
52
+ // The user's own unlink: the pane stays on its ticker until they link it again.
53
+ return pinFollowingPane(mnemonic ? { ...current, title: mnemonic } : current, symbol, contract, {
54
+ sourcePaneId: sourceInstanceId ? sourcePaneId(sourceInstanceId) : undefined,
55
+ });
53
56
  }));
54
57
  };
55
58
  const linkToSource = (nextSourceId: string) => {
@@ -59,11 +62,7 @@ export function tickerLinkMenuItems({
59
62
  if (current.instanceId === instance.instanceId) {
60
63
  // The stored title drops its ticker ("OMON AAPL" to "OMON"); the header adds the live one.
61
64
  const mnemonic = research ? null : paneTitleMnemonic(current.title);
62
- return {
63
- ...current,
64
- ...(mnemonic ? { title: mnemonic } : {}),
65
- binding: { kind: "follow" as const, sourceInstanceId: nextSourceId },
66
- };
65
+ return linkFollower(mnemonic ? { ...current, title: mnemonic } : current, nextSourceId);
67
66
  }
68
67
  // Ticker Research keeps one follower per source, so Enter on a source row has one target.
69
68
  // Any number of other panes may follow the same source.
@@ -73,7 +72,11 @@ export function tickerLinkMenuItems({
73
72
  || current.binding?.kind !== "follow"
74
73
  || current.binding.sourceInstanceId !== nextSourceId
75
74
  ) return current;
76
- return pinFollowingPane(current, resolveTickerForPane(state as AppState, current.instanceId));
75
+ // The pane it displaces follows the source again once this one leaves it.
76
+ return pinFollowingPane(current, resolveTickerForPane(state as AppState, current.instanceId), undefined, {
77
+ auto: true,
78
+ sourcePaneId: sourcePaneId(nextSourceId),
79
+ });
77
80
  }),
78
81
  });
79
82
  };
@@ -48,9 +48,9 @@ export function TuiDialogList({ descriptionColor, ...props }: ListViewProps & {
48
48
  );
49
49
  }
50
50
 
51
- export function TuiUnavailablePaneSettingsDialog() {
51
+ export function TuiUnavailablePaneSettingsDialog({ dismiss }: { dismiss?: () => void }) {
52
52
  return (
53
- <DialogFrame title={t("Pane Settings")} footer={t("Press esc to cancel")}>
53
+ <DialogFrame title={t("Pane Settings")} footer={t("Press esc to cancel")} onClose={dismiss}>
54
54
  <Text fg={colors.textDim}>{t("This pane is no longer configurable.")}</Text>
55
55
  </DialogFrame>
56
56
  );
@@ -58,6 +58,7 @@ export function TuiUnavailablePaneSettingsDialog() {
58
58
 
59
59
  export function TuiPaneSettingsDialogBody({
60
60
  title,
61
+ dismiss,
61
62
  fields,
62
63
  selectedIndex,
63
64
  settings,
@@ -66,6 +67,8 @@ export function TuiPaneSettingsDialogBody({
66
67
  onActivate,
67
68
  }: {
68
69
  title: string;
70
+ /** The close button in the title, for a mouse; Esc closes too. */
71
+ dismiss?: () => void;
69
72
  fields: PaneSettingField[];
70
73
  selectedIndex: number;
71
74
  settings: Record<string, unknown>;
@@ -76,7 +79,7 @@ export function TuiPaneSettingsDialogBody({
76
79
  }) {
77
80
  const notes = fields.map((field) => noteFor?.(field) ?? null);
78
81
  return (
79
- <DialogFrame title={t(title)}>
82
+ <DialogFrame title={t(title)} onClose={dismiss}>
80
83
  <TuiDialogList
81
84
  items={fields.map((field, index) => ({
82
85
  id: field.key,
@@ -209,7 +209,7 @@ export function PaneSettingsDialogContent({
209
209
  if (!descriptor) {
210
210
  return isDesktop
211
211
  ? <DesktopUnavailablePaneSettingsDialog dismiss={dismiss} />
212
- : <TuiUnavailablePaneSettingsDialog />;
212
+ : <TuiUnavailablePaneSettingsDialog dismiss={dismiss} />;
213
213
  }
214
214
 
215
215
  const title = descriptor.settingsDef.title ?? `${descriptor.paneDef.name} Settings`;
@@ -236,6 +236,7 @@ export function PaneSettingsDialogContent({
236
236
  ) : (
237
237
  <TuiPaneSettingsDialogBody
238
238
  title={title}
239
+ dismiss={dismiss}
239
240
  fields={fields}
240
241
  selectedIndex={selectedIndex}
241
242
  settings={descriptor.context.settings}
@@ -9,6 +9,7 @@ import { t, tf } from "../i18n";
9
9
 
10
10
  export function PaneTemplateInputStep({
11
11
  resolve,
12
+ dismiss,
12
13
  step,
13
14
  }: PromptContext<string> & { step: WizardStep }) {
14
15
  const inputRef = useRef<InputRenderable>(null);
@@ -21,6 +22,7 @@ export function PaneTemplateInputStep({
21
22
  return (
22
23
  <DialogFrame
23
24
  title={step.label}
25
+ onClose={dismiss}
24
26
  footer={step.defaultValue
25
27
  ? `Press Enter to use ${step.defaultValue}`
26
28
  : step.required === false
@@ -59,21 +59,30 @@ export interface TickerBadgeTextOptions {
59
59
  * worse than no price, so the badge drops back to whatever still fits.
60
60
  */
61
61
  maxTextWidth?: number;
62
+ /**
63
+ * A move in percent to say instead of the day's change, over a span the
64
+ * caller names beside the chips (since the user's last visit).
65
+ */
66
+ move?: number;
62
67
  }
63
68
 
64
69
  /**
65
- * Candidates run richest first: the day's change, then the bare symbol, which
66
- * always fits because the caller sized the column for it.
70
+ * Candidates run richest first: the move (the day's change unless the caller
71
+ * gives another), then the bare symbol, which always fits because the caller
72
+ * sized the column for it.
67
73
  */
68
74
  function tickerBadgeTextCandidates({
69
75
  symbol,
70
76
  status,
71
77
  quote,
72
78
  liveQuote = true,
79
+ move,
73
80
  }: TickerBadgeTextOptions): string[] {
74
81
  const candidates: string[] = [];
75
82
  if (liveQuote) {
76
- if (status === "ready" && quote && Number.isFinite(quote.changePercent)) {
83
+ if (status === "ready" && move != null && Number.isFinite(move)) {
84
+ candidates.push(`${symbol} ${formatTickerBadgeChange(move)}`);
85
+ } else if (status === "ready" && quote && Number.isFinite(quote.changePercent)) {
77
86
  candidates.push(`${symbol} ${formatTickerBadgeChange(quote.changePercent)}`);
78
87
  } else if (status === "loading") {
79
88
  candidates.push(`${symbol} \u2026`);
@@ -21,6 +21,8 @@ export interface TickerBadgeProps {
21
21
  maxTextWidth?: number;
22
22
  /** Trailing gap to the next chip, which the last chip in a row does not need. */
23
23
  trailingGap?: boolean;
24
+ /** A move in percent the chip says and takes its tone from, instead of the day's change. */
25
+ move?: number;
24
26
  onHoverStart?: () => void;
25
27
  onHoverEnd?: () => void;
26
28
  onOpen: (symbol: string) => void;
@@ -46,6 +48,7 @@ export function TickerBadge({
46
48
  hovered = false,
47
49
  maxTextWidth,
48
50
  trailingGap = true,
51
+ move,
49
52
  onHoverStart,
50
53
  onHoverEnd,
51
54
  onOpen,
@@ -61,11 +64,14 @@ export function TickerBadge({
61
64
  onOpen,
62
65
  });
63
66
  const quoteForDisplay = liveQuote ? quote : null;
64
- const tone = status === "ready" && quoteForDisplay
67
+ const shownMove = liveQuote && move != null && Number.isFinite(move) ? move : null;
68
+ const tone = status === "ready" && shownMove != null
69
+ ? priceColor(shownMove)
70
+ : status === "ready" && quoteForDisplay
65
71
  ? priceColor(quoteForDisplay.changePercent)
66
72
  : colors.borderFocused;
67
- const text = getTickerBadgeText({ symbol, status, quote, liveQuote, maxTextWidth });
68
- const price = hovered ? getTickerBadgeHoverText({ symbol, status, quote, liveQuote, maxTextWidth }) : null;
73
+ const text = getTickerBadgeText({ symbol, status, quote, liveQuote, maxTextWidth, move });
74
+ const price = hovered ? getTickerBadgeHoverText({ symbol, status, quote, liveQuote, maxTextWidth, move }) : null;
69
75
  const { fg: color, bg: backgroundColor } = tickerBadgeColors(tone, hovered);
70
76
  // An ambiguous symbol is worth opening: that is how the listing gets picked.
71
77
  const interactive = status !== "loading";