gloomberb 0.20.4 → 0.20.6

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 (316) hide show
  1. package/README.md +3 -1
  2. package/README.zh-CN.md +1 -1
  3. package/bin/gloom +9 -0
  4. package/bin/without-bun.cjs +98 -0
  5. package/package.json +4 -1
  6. package/src/api-client/data.ts +148 -37
  7. package/src/api-client/hk-tenders.ts +59 -0
  8. package/src/api-client/index.ts +1 -0
  9. package/src/api-client/types/econ.ts +30 -0
  10. package/src/api-client/yield-curves.ts +1 -1
  11. package/src/app/global-shortcuts.ts +4 -1
  12. package/src/app/keybindings/actions.ts +6 -0
  13. package/src/app/keybindings/config.ts +2 -1
  14. package/src/app/keybindings/index.ts +1 -0
  15. package/src/app/keybindings/labels.ts +6 -1
  16. package/src/app/keybindings/resolve.ts +23 -4
  17. package/src/app/keybindings/terminal-keys.ts +35 -0
  18. package/src/app/pane-runtime/index.tsx +2 -2
  19. package/src/app/pane-runtime/ticker-open-runtime.ts +68 -40
  20. package/src/app.tsx +18 -13
  21. package/src/architecture/floating-promise-allowlist.json +313 -0
  22. package/src/architecture/ui-literals-allowlist.json +1 -1
  23. package/src/capabilities/chart-series.ts +27 -1
  24. package/src/cli/commands/keybindings.ts +5 -5
  25. package/src/cli/commands/market.ts +238 -57
  26. package/src/cli/commands/news-search.ts +81 -14
  27. package/src/cli/commands/overview.ts +27 -6
  28. package/src/cli/commands/remote.ts +16 -17
  29. package/src/cli/commands/system.ts +1 -1
  30. package/src/cli/commands/ticker.ts +3 -1
  31. package/src/cli/early-command.ts +2 -0
  32. package/src/cli/errors.ts +10 -1
  33. package/src/cli/fx-forward.ts +89 -7
  34. package/src/cli/fx-pair.ts +1 -1
  35. package/src/cli/fx-quote-rate.ts +23 -0
  36. package/src/cli/glossary.ts +19 -5
  37. package/src/cli/help.ts +1 -0
  38. package/src/cli/history-rows.ts +5 -3
  39. package/src/cli/index-roots.ts +5 -4
  40. package/src/cli/index.ts +40 -3
  41. package/src/cli/known-gaps.ts +38 -9
  42. package/src/cli/listing-arg.ts +17 -5
  43. package/src/cli/name-entries.ts +5 -1
  44. package/src/cli/not-a-ticker.ts +4 -0
  45. package/src/cli/options.ts +52 -3
  46. package/src/cli/output-file.ts +5 -3
  47. package/src/cli/pane-functions/catalog.ts +15 -0
  48. package/src/cli/pane-functions/function-help.ts +4 -4
  49. package/src/cli/pane-functions/headless.ts +9 -4
  50. package/src/cli/pane-functions/index.ts +6 -4
  51. package/src/cli/pane-functions/resolver.ts +2 -2
  52. package/src/cli/result.ts +21 -2
  53. package/src/cli/spreadsheet-hint.ts +7 -3
  54. package/src/cli/treasury-yields.ts +5 -3
  55. package/src/components/chart/composite/legend.tsx +40 -2
  56. package/src/components/command-bar/pane-settings.ts +2 -2
  57. package/src/components/command-bar/routes/root/results.ts +6 -2
  58. package/src/components/command-bar/workflow/tickers.ts +2 -2
  59. package/src/components/data-table/view.tsx +9 -2
  60. package/src/components/input-search-bar.tsx +9 -2
  61. package/src/components/layout/pane/header.tsx +2 -0
  62. package/src/components/layout/shell/pane/capture.ts +4 -1
  63. package/src/components/layout/status-bar.tsx +6 -1
  64. package/src/components/onboarding/first-run-workspace.ts +44 -2
  65. package/src/components/onboarding/onboarding-frame.tsx +11 -2
  66. package/src/components/onboarding/onboarding-keyboard.ts +16 -0
  67. package/src/components/onboarding/onboarding-wizard.tsx +8 -8
  68. package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
  69. package/src/components/onboarding/use-onboarding-progress.ts +12 -4
  70. package/src/components/pane-settings-dialog/desktop.tsx +2 -2
  71. package/src/components/pane-settings-dialog/tui.tsx +2 -2
  72. package/src/components/pane-settings-dialog/value.ts +6 -0
  73. package/src/components/pane-settings-dialog.tsx +3 -3
  74. package/src/components/reader/detail-reader.tsx +4 -0
  75. package/src/components/ui/data-table/opentui/index.tsx +11 -4
  76. package/src/components/ui/data-table/opentui/model.ts +8 -6
  77. package/src/components/ui/data-table/types.ts +6 -1
  78. package/src/components/ui/index.ts +1 -1
  79. package/src/components/ui/page-stack-view.tsx +3 -0
  80. package/src/components/ui/pane-link-chip.tsx +269 -54
  81. package/src/components/ui/query-bar.tsx +2 -1
  82. package/src/components/ui/table-layout.ts +38 -1
  83. package/src/components/ui/tabs.tsx +97 -19
  84. package/src/core/state/app/layout-reducer.ts +7 -0
  85. package/src/core/state/app/layout.ts +44 -7
  86. package/src/core/state/app/state.ts +1 -1
  87. package/src/core/state/app/types.ts +22 -2
  88. package/src/docs/snapshot.json +30 -13
  89. package/src/market-data/depositary-pair.ts +5 -3
  90. package/src/market-data/market/change-basis.ts +9 -5
  91. package/src/market-data/market/dated-previous-close.ts +147 -17
  92. package/src/market-data/market/status.ts +17 -1
  93. package/src/market-data/quotes/contributions.ts +2 -0
  94. package/src/market-data/quotes/listing-enterprise-value.ts +50 -0
  95. package/src/plugins/builtin/alerts/metric-data.ts +15 -2
  96. package/src/plugins/builtin/analytics/risk-client.ts +10 -4
  97. package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
  98. package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
  99. package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
  100. package/src/plugins/builtin/awards/index.tsx +1 -1
  101. package/src/plugins/builtin/backtest/headless.ts +1 -1
  102. package/src/plugins/builtin/buildout/index.tsx +1 -0
  103. package/src/plugins/builtin/catalysts/index.tsx +2 -2
  104. package/src/plugins/builtin/cds/headless.ts +4 -0
  105. package/src/plugins/builtin/cds/model.ts +0 -6
  106. package/src/plugins/builtin/chart-composer/formula.ts +16 -3
  107. package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -0
  108. package/src/plugins/builtin/chart-composer/headless.ts +4 -2
  109. package/src/plugins/builtin/chart-composer/index.tsx +1 -0
  110. package/src/plugins/builtin/chart-composer/presets.ts +1 -0
  111. package/src/plugins/builtin/chat/content/composer.tsx +5 -4
  112. package/src/plugins/builtin/chat/content/index.tsx +12 -2
  113. package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
  114. package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
  115. package/src/plugins/builtin/chat/layout.ts +5 -2
  116. package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
  117. package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
  118. package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
  119. package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
  120. package/src/plugins/builtin/cloud/askg/pane.tsx +55 -13
  121. package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
  122. package/src/plugins/builtin/cloud/terminal-relay/redact.ts +5 -3
  123. package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
  124. package/src/plugins/builtin/company-attention/index.tsx +1 -1
  125. package/src/plugins/builtin/company-kpis/headless.ts +3 -1
  126. package/src/plugins/builtin/company-kpis/index.tsx +2 -2
  127. package/src/plugins/builtin/cot/index.tsx +1 -1
  128. package/src/plugins/builtin/cpi/index.tsx +1 -1
  129. package/src/plugins/builtin/credit-boards/cdx-pane.tsx +20 -7
  130. package/src/plugins/builtin/credit-boards/client.ts +8 -0
  131. package/src/plugins/builtin/credit-boards/headless.ts +4 -1
  132. package/src/plugins/builtin/credit-boards/model.ts +58 -4
  133. package/src/plugins/builtin/credit-boards/series.ts +63 -6
  134. package/src/plugins/builtin/credit-boards/sovr-pane.tsx +3 -2
  135. package/src/plugins/builtin/credit-conditions/headless.ts +24 -6
  136. package/src/plugins/builtin/credit-conditions/index.tsx +1 -1
  137. package/src/plugins/builtin/credit-conditions/model.ts +12 -6
  138. package/src/plugins/builtin/credit-conditions/series.ts +2 -1
  139. package/src/plugins/builtin/crypto-board/index.tsx +1 -0
  140. package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
  141. package/src/plugins/builtin/doe/index.tsx +1 -1
  142. package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
  143. package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
  144. package/src/plugins/builtin/econ/calendar-model.ts +115 -8
  145. package/src/plugins/builtin/econ/calendar-source.ts +7 -1
  146. package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
  147. package/src/plugins/builtin/econ/index.tsx +42 -8
  148. package/src/plugins/builtin/econ/types.ts +3 -0
  149. package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
  150. package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
  151. package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
  152. package/src/plugins/builtin/executives/index.tsx +1 -0
  153. package/src/plugins/builtin/filing-events/index.tsx +1 -0
  154. package/src/plugins/builtin/fixed-income/index.tsx +3 -0
  155. package/src/plugins/builtin/futures-curve/headless.ts +3 -3
  156. package/src/plugins/builtin/futures-curve/index.tsx +1 -1
  157. package/src/plugins/builtin/futures-curve/model.ts +18 -0
  158. package/src/plugins/builtin/fx-matrix/index.tsx +44 -14
  159. package/src/plugins/builtin/gpu/index.tsx +1 -1
  160. package/src/plugins/builtin/help/functions-table.tsx +1 -1
  161. package/src/plugins/builtin/help/index.tsx +11 -1
  162. package/src/plugins/builtin/help/keybindings-editor.tsx +7 -3
  163. package/src/plugins/builtin/holders/index.tsx +1 -0
  164. package/src/plugins/builtin/holders/report-header.ts +2 -2
  165. package/src/plugins/builtin/insider/index.tsx +1 -0
  166. package/src/plugins/builtin/iv-history/index.tsx +1 -1
  167. package/src/plugins/builtin/jobs/index.tsx +1 -0
  168. package/src/plugins/builtin/macro-day/headless.ts +27 -8
  169. package/src/plugins/builtin/macro-day/index.tsx +1 -1
  170. package/src/plugins/builtin/macro-day/model.ts +19 -3
  171. package/src/plugins/builtin/macro-day/pane.tsx +14 -9
  172. package/src/plugins/builtin/macro-day/releases.ts +25 -7
  173. package/src/plugins/builtin/market-valuation/index.tsx +1 -0
  174. package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
  175. package/src/plugins/builtin/members/index.tsx +1 -1
  176. package/src/plugins/builtin/mna/index.tsx +1 -0
  177. package/src/plugins/builtin/news/index.tsx +1 -0
  178. package/src/plugins/builtin/news/wire/index.tsx +5 -1
  179. package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
  180. package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
  181. package/src/plugins/builtin/options/index.tsx +1 -0
  182. package/src/plugins/builtin/options-positioning/index.tsx +1 -0
  183. package/src/plugins/builtin/pe-band/index.tsx +1 -1
  184. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
  185. package/src/plugins/builtin/portfolio-list/cli/render.ts +20 -3
  186. package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +5 -1
  187. package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
  188. package/src/plugins/builtin/power/index.tsx +1 -1
  189. package/src/plugins/builtin/realized-vol/index.tsx +1 -1
  190. package/src/plugins/builtin/research/headless-schema.ts +4 -3
  191. package/src/plugins/builtin/research/headless.ts +10 -4
  192. package/src/plugins/builtin/research/index.tsx +4 -0
  193. package/src/plugins/builtin/research/relative-valuation-columns.ts +145 -47
  194. package/src/plugins/builtin/research/relative-valuation-currency.ts +31 -0
  195. package/src/plugins/builtin/research/relative-valuation-headless.ts +25 -8
  196. package/src/plugins/builtin/research/relative-valuation-model.ts +40 -9
  197. package/src/plugins/builtin/research/relative-valuation-pane.tsx +3 -2
  198. package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -2
  199. package/src/plugins/builtin/research-search/index.tsx +1 -0
  200. package/src/plugins/builtin/research-search/pane.tsx +8 -0
  201. package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
  202. package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
  203. package/src/plugins/builtin/risk-factors/index.tsx +1 -0
  204. package/src/plugins/builtin/scanner/headless.ts +52 -13
  205. package/src/plugins/builtin/seasonality/index.tsx +1 -1
  206. package/src/plugins/builtin/sec/index.tsx +1 -0
  207. package/src/plugins/builtin/series-inventory.ts +1 -1
  208. package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
  209. package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
  210. package/src/plugins/builtin/short-interest/index.tsx +1 -0
  211. package/src/plugins/builtin/social-mentions/index.tsx +1 -1
  212. package/src/plugins/builtin/supply-chain/index.tsx +1 -0
  213. package/src/plugins/builtin/thirteenf/api.ts +47 -4
  214. package/src/plugins/builtin/thirteenf/data.ts +43 -10
  215. package/src/plugins/builtin/thirteenf/headless.ts +55 -11
  216. package/src/plugins/builtin/thirteenf/model.ts +25 -9
  217. package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
  218. package/src/plugins/builtin/thirteenf/types.ts +2 -0
  219. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
  220. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +8 -7
  221. package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +8 -5
  222. package/src/plugins/builtin/ticker-detail/financials/model.ts +18 -2
  223. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
  224. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +6 -6
  225. package/src/plugins/builtin/ticker-detail/headless.ts +24 -17
  226. package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
  227. package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
  228. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +6 -4
  229. package/src/plugins/builtin/time-sales/client.ts +9 -11
  230. package/src/plugins/builtin/time-sales/index.tsx +1 -1
  231. package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
  232. package/src/plugins/builtin/treasury-auctions/cache.ts +54 -5
  233. package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
  234. package/src/plugins/builtin/treasury-auctions/headless.ts +150 -22
  235. package/src/plugins/builtin/treasury-auctions/hk-headless.ts +126 -0
  236. package/src/plugins/builtin/treasury-auctions/hk-view.tsx +347 -0
  237. package/src/plugins/builtin/treasury-auctions/hk.ts +363 -0
  238. package/src/plugins/builtin/treasury-auctions/index.tsx +27 -4
  239. package/src/plugins/builtin/treasury-auctions/model.ts +264 -28
  240. package/src/plugins/builtin/treasury-auctions/pane.tsx +176 -41
  241. package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
  242. package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
  243. package/src/plugins/builtin/vol-surface/index.tsx +1 -1
  244. package/src/plugins/builtin/world-venue-map/index.ts +1 -0
  245. package/src/plugins/builtin/yield-curve/curves.ts +10 -4
  246. package/src/plugins/builtin/yield-curve/headless.ts +6 -2
  247. package/src/plugins/builtin/yield-curve/index.tsx +3 -3
  248. package/src/plugins/builtin/yield-curve/series.ts +10 -0
  249. package/src/plugins/builtin/yield-curve/world.ts +3 -1
  250. package/src/portfolio/collection-name.ts +22 -0
  251. package/src/portfolio/column-values.ts +2 -1
  252. package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
  253. package/src/public/remote.ts +7 -1
  254. package/src/remote/client.ts +191 -11
  255. package/src/remote/controller-utils.ts +13 -1
  256. package/src/remote/controller.ts +88 -26
  257. package/src/remote/endpoint.ts +24 -0
  258. package/src/remote/form.ts +59 -4
  259. package/src/remote/resources.ts +44 -18
  260. package/src/remote/schema.ts +21 -9
  261. package/src/remote/secrets.ts +12 -0
  262. package/src/remote/semantic-tree.tsx +14 -2
  263. package/src/remote/server.ts +2 -1
  264. package/src/remote/surface.tsx +192 -0
  265. package/src/remote/types.ts +5 -0
  266. package/src/renderers/dom/data-table/frozen-column.ts +3 -1
  267. package/src/renderers/dom/data-table/index.tsx +27 -9
  268. package/src/renderers/dom/data-table/row.tsx +2 -0
  269. package/src/renderers/electrobun/bun/desktop/backend.ts +27 -24
  270. package/src/renderers/electrobun/bun/desktop/detached-windows.ts +3 -3
  271. package/src/renderers/electrobun/bun/desktop/snapshot-commit.ts +77 -0
  272. package/src/renderers/electrobun/shared/protocol.ts +4 -0
  273. package/src/renderers/electrobun/view/backend-rpc.ts +3 -0
  274. package/src/renderers/electrobun/view/desktop/window/bridge.ts +3 -0
  275. package/src/renderers/opentui/host.tsx +6 -0
  276. package/src/series/standalone.ts +2 -2
  277. package/src/shares/api.ts +21 -4
  278. package/src/shares/item.ts +73 -0
  279. package/src/shares/pane-item.ts +205 -0
  280. package/src/shares/pane.ts +4 -0
  281. package/src/shares/payload.ts +9 -5
  282. package/src/sources/gloomberb-cloud/news.ts +2 -0
  283. package/src/sources/gloomberb-cloud/normalizers.ts +9 -5
  284. package/src/sources/provider-router/cache.ts +3 -1
  285. package/src/sync/controller.ts +17 -2
  286. package/src/sync/other-window-tabs.ts +32 -1
  287. package/src/sync/react.ts +4 -4
  288. package/src/tickers/renamed-listings.ts +105 -0
  289. package/src/tickers/search/index.ts +103 -16
  290. package/src/time-series/bar-spacing.ts +33 -0
  291. package/src/time-series/base-series.ts +21 -3
  292. package/src/time-series/chart-bounds.ts +31 -0
  293. package/src/time-series/field-catalog.ts +17 -0
  294. package/src/time-series/fundamentals.ts +143 -11
  295. package/src/time-series/ice-credit.ts +32 -6
  296. package/src/time-series/resolve.ts +11 -7
  297. package/src/time-series/session-bar.ts +78 -9
  298. package/src/time-series/studies/formula.ts +53 -10
  299. package/src/time-series/studies/pair.ts +18 -7
  300. package/src/time-series/studies/units.ts +49 -2
  301. package/src/time-series/types.ts +12 -0
  302. package/src/types/desktop-window.ts +2 -0
  303. package/src/types/financials.ts +7 -0
  304. package/src/types/headless.ts +8 -0
  305. package/src/types/plugin-pane-settings.ts +2 -0
  306. package/src/types/plugin-panes.ts +22 -0
  307. package/src/utils/central-banks.ts +86 -1
  308. package/src/utils/cli-output.ts +6 -3
  309. package/src/utils/datetime-format.ts +12 -3
  310. package/src/utils/depositary-receipt.ts +28 -3
  311. package/src/utils/ebitda.ts +128 -0
  312. package/src/utils/format.ts +1 -1
  313. package/src/utils/fundamentals.ts +14 -0
  314. package/src/utils/max-drawdown.ts +97 -16
  315. package/src/utils/shell-word.ts +13 -0
  316. package/src/utils/untrusted-text.ts +29 -0
@@ -9,6 +9,8 @@ import { formatPercentRaw } from "../../../utils/format";
9
9
  import { Button, NumberField, TextField } from "../../ui";
10
10
  import { DelayedMark } from "../../ui/delayed-mark";
11
11
  import { useFreeQuoteDelay } from "../../../api-client/plan-access";
12
+ import { useRemoteUiNode } from "../../../remote/semantic-tree";
13
+ import { remoteStringValue } from "../../../remote/semantic-helpers";
12
14
  import { ONBOARDING_DESKTOP } from "../onboarding-frame";
13
15
  import {
14
16
  POSITION_FIELDS,
@@ -379,7 +381,66 @@ export interface PositionsPanelProps {
379
381
  shortcut: string;
380
382
  }
381
383
 
384
+ /**
385
+ * One field of the position form as remote control fills it, the same on both
386
+ * hosts: the terminal draws only the field being typed in as an input, and
387
+ * Enter there is the card's key, not the input's. `submit` adds the position,
388
+ * as the desktop's Add button does.
389
+ */
390
+ function RemotePositionField({ field, index, state, editing }: { field: PositionFieldId; index: number; state: OnboardingPositionsState; editing: boolean }) {
391
+ useRemoteUiNode({
392
+ role: "form-field",
393
+ label: fieldLabel(field, state),
394
+ disabled: state.submitting,
395
+ actions: {
396
+ focus: () => state.focusField(index),
397
+ setValue: (input) => state.setField(field, remoteStringValue(input)),
398
+ submit: () => state.addPosition(),
399
+ },
400
+ metadata: {
401
+ fieldId: field,
402
+ fieldType: field === "shares" || field === "avgCost" ? "number" : "text",
403
+ active: editing && index === state.fieldIdx,
404
+ value: state.draft[field],
405
+ placeholder: fieldPlaceholder(field, state),
406
+ ...(field === "ticker" && state.error ? { error: state.error } : {}),
407
+ },
408
+ });
409
+ return null;
410
+ }
411
+
412
+ /** The positions added so far, as remote control reads them; `remove` takes one off by its symbol or index. */
413
+ function RemotePositionList({ state }: { state: OnboardingPositionsState }) {
414
+ useRemoteUiNode({
415
+ role: "list",
416
+ label: t("Positions"),
417
+ actions: {
418
+ remove: (input) => {
419
+ const record = input && typeof input === "object" ? input as { id?: unknown; index?: unknown } : {};
420
+ const symbol = typeof record.index === "number"
421
+ ? state.positions[record.index]?.symbol
422
+ : typeof record.id === "string" ? record.id : remoteStringValue(input, "");
423
+ const row = state.positions.find((entry) => entry.symbol === symbol?.toUpperCase());
424
+ if (!row) throw new Error(`No position ${symbol ? `"${symbol}"` : "at that index"} is listed.`);
425
+ return state.removePosition(row.symbol);
426
+ },
427
+ },
428
+ metadata: {
429
+ items: state.positions.map((row, index) => ({ index, id: row.symbol, label: row.symbol, detail: positionSummary(row) })),
430
+ },
431
+ });
432
+ return null;
433
+ }
434
+
382
435
  export function PositionsPanel(props: PositionsPanelProps) {
383
436
  const desktop = useUiCapabilities().nativePaneChrome === true;
384
- return desktop ? <DesktopPositionsPanel {...props} /> : <TuiPositionsPanel {...props} />;
437
+ return (
438
+ <>
439
+ {POSITION_FIELDS.map((field, index) => (
440
+ <RemotePositionField key={field} field={field} index={index} state={props.state} editing={props.editing} />
441
+ ))}
442
+ <RemotePositionList state={props.state} />
443
+ {desktop ? <DesktopPositionsPanel {...props} /> : <TuiPositionsPanel {...props} />}
444
+ </>
445
+ );
385
446
  }
@@ -14,6 +14,7 @@ import {
14
14
  applyFirstRunLayout,
15
15
  buildFirstRunLayout,
16
16
  FIRST_RUN_WATCHLIST,
17
+ isCompactHomeViewport,
17
18
  onboardingDeskLayoutId,
18
19
  planFirstRunWatchlist,
19
20
  setupDeskPicks,
@@ -28,6 +29,7 @@ import {
28
29
  type BrokerOption,
29
30
  } from "./wizard-model";
30
31
  import { logFailure } from "../../utils/log-failure";
32
+ import { useViewport } from "../../react/input";
31
33
 
32
34
  const onboardingLog = debugLog.createLogger("onboarding");
33
35
 
@@ -109,6 +111,10 @@ export function useOnboardingWorkspace({
109
111
  const [deskCursor, setDeskCursor] = useState(0);
110
112
  const [buildingDesks, setBuildingDesks] = useState(false);
111
113
  const buildingDesksRef = useRef(false);
114
+ // The window the workspace is built for: a small terminal gets the compact Home.
115
+ const viewport = useViewport();
116
+ const viewportRef = useRef(viewport);
117
+ viewportRef.current = viewport;
112
118
 
113
119
  /**
114
120
  * Seeds the watchlist and swaps Home for the first-run workspace built
@@ -152,18 +158,20 @@ export function useOnboardingWorkspace({
152
158
  onboardingLog.error("First-run watchlist update failed", { symbol: ticker.metadata.ticker, error: String(error) });
153
159
  }
154
160
  }
161
+ const { tickers, financials } = stateRef.current;
162
+ const held = [...tickers.values()]
163
+ .filter((ticker) => ticker.metadata.portfolios.includes(portfolioId))
164
+ .map((ticker) => ticker.metadata.ticker);
155
165
  const home = buildFirstRunLayout({
156
166
  symbol,
157
167
  portfolioId,
158
168
  watchlistId,
159
169
  hasPane: (paneId) => pluginRegistry.panes?.has(paneId) ?? false,
170
+ compact: isCompactHomeViewport(viewportRef.current),
171
+ holdings: held.length > 0,
160
172
  });
161
173
  const workspace = applyFirstRunLayout(config, home, [], { rerun });
162
174
  if (desks.length === 0) return workspace;
163
- const { tickers, financials } = stateRef.current;
164
- const held = [...tickers.values()]
165
- .filter((ticker) => ticker.metadata.portfolios.includes(portfolioId))
166
- .map((ticker) => ticker.metadata.ticker);
167
175
  const company = pickDeskCompany([symbol, ...held], (candidate) => (
168
176
  isDeskStock(tickers.get(candidate), financials.get(candidate))
169
177
  ));
@@ -7,7 +7,7 @@ import { Checkbox } from "../ui/checkbox";
7
7
  import { Button } from "../ui/button";
8
8
  import { Badge } from "../ui/display";
9
9
  import { DialogFrame } from "../ui/frame";
10
- import { isPaneSettingDisabled, noteColor, summarizePaneSettingValue } from "./value";
10
+ import { isPaneSettingDisabled, noteColor, paneSettingValue, summarizePaneSettingValue } from "./value";
11
11
 
12
12
  const DESKTOP_TEXT_STYLE = {
13
13
  letterSpacing: 0,
@@ -190,7 +190,7 @@ function DesktopSettingsList({
190
190
  key={field.key}
191
191
  field={field}
192
192
  selected={index === selectedIndex}
193
- currentValue={settings[field.key]}
193
+ currentValue={paneSettingValue(field, settings)}
194
194
  note={noteFor?.(field) ?? null}
195
195
  onHover={() => onHover(field, index)}
196
196
  onEdit={() => onEdit(field, index)}
@@ -6,7 +6,7 @@ import { colors } from "../../theme/colors";
6
6
  import { useViewport } from "../../react/input";
7
7
  import { DialogFrame, ListView } from "../ui";
8
8
  import type { ListViewProps } from "../ui/list-view";
9
- import { isPaneSettingDisabled, noteColor, summarizePaneSettingValue } from "./value";
9
+ import { isPaneSettingDisabled, noteColor, paneSettingValue, summarizePaneSettingValue } from "./value";
10
10
 
11
11
  /** Terminal rows a settings dialog spends around its list: edge, frame, title, description. */
12
12
  const TUI_DIALOG_LIST_CHROME_ROWS = 11;
@@ -82,7 +82,7 @@ export function TuiPaneSettingsDialogBody({
82
82
  id: field.key,
83
83
  label: t(field.label),
84
84
  description: notes[index]?.text ?? (field.description ? t(field.description) : field.description),
85
- detail: notes[index]?.status ?? summarizePaneSettingValue(field, settings[field.key]),
85
+ detail: notes[index]?.status ?? summarizePaneSettingValue(field, paneSettingValue(field, settings)),
86
86
  disabled: isPaneSettingDisabled(field),
87
87
  }))}
88
88
  descriptionColor={(index) => (notes[index]?.text ? noteColor(notes[index]) : undefined)}
@@ -17,6 +17,12 @@ export function noteColor(note: PaneSettingRowNote | null | undefined): string |
17
17
  return note.tone === "negative" ? colors.negative : colors.warning;
18
18
  }
19
19
 
20
+ /** A field's value in a pane's settings, an unset select reading as its default option. */
21
+ export function paneSettingValue(field: PaneSettingField, settings: Readonly<Record<string, unknown>>): unknown {
22
+ const value = settings[field.key];
23
+ return value == null && field.type === "select" ? field.defaultValue : value;
24
+ }
25
+
20
26
  export function summarizePaneSettingValue(field: PaneSettingField, value: unknown): string {
21
27
  switch (field.type) {
22
28
  case "action":
@@ -19,7 +19,7 @@ import {
19
19
  TuiPaneSettingsDialogBody,
20
20
  TuiUnavailablePaneSettingsDialog,
21
21
  } from "./pane-settings-dialog/tui";
22
- import { isPaneSettingDisabled, isSpaceKey, stepPaneSettingSelect } from "./pane-settings-dialog/value";
22
+ import { isPaneSettingDisabled, isSpaceKey, paneSettingValue, stepPaneSettingSelect } from "./pane-settings-dialog/value";
23
23
  import { useRowNotes } from "./ui/row-notes";
24
24
  import { logFailure } from "../utils/log-failure";
25
25
 
@@ -118,7 +118,7 @@ export function PaneSettingsDialogContent({
118
118
  if (!closed && mounted.current) setSettingsRevision((revision) => revision + 1);
119
119
  return;
120
120
  }
121
- const currentValue = descriptor.context.settings[field.key];
121
+ const currentValue = paneSettingValue(field, descriptor.context.settings);
122
122
 
123
123
  if (field.type === "toggle") {
124
124
  await applyAndRefresh(field, currentValue !== true);
@@ -175,7 +175,7 @@ export function PaneSettingsDialogContent({
175
175
  /** Left and right change a toggle or step a select in place, the way a settings list does. */
176
176
  const stepField = (field: PaneSettingField | undefined, direction: -1 | 1) => {
177
177
  if (!field || !descriptor) return;
178
- const currentValue = descriptor.context.settings[field.key];
178
+ const currentValue = paneSettingValue(field, descriptor.context.settings);
179
179
  if (field.type === "toggle") {
180
180
  void applyAndRefresh(field, currentValue !== true).catch(logFailure("pane-settings-dialog", "Toggle pane setting failed"));
181
181
  return;
@@ -9,6 +9,8 @@ import { DetailScrollBody } from "../ui/detail-scroll-body";
9
9
  import { KeyValueRow } from "../ui/display";
10
10
  import { ExternalLink, usePaneLinkMenuEntry } from "../ui/external-link";
11
11
  import { parseArticle } from "./article-text";
12
+ import { shareItemExcerpt } from "../../shares/item";
13
+ import { usePaneShareItem } from "../../shares/pane-item";
12
14
  import { DESKTOP_LINE_HEIGHT, READER_APP_FONT, READER_COLUMN_FONT, READER_HEADING_STYLE, READER_MEASURE, ReaderBlock, ReaderText, type ReaderGeometry } from "./reader-text";
13
15
 
14
16
  export interface DetailFact {
@@ -82,6 +84,8 @@ export const DetailReader = forwardRef<ScrollBoxRenderable, DetailReaderProps>(f
82
84
  ref,
83
85
  ) {
84
86
  const { nativePaneChrome } = useUiCapabilities();
87
+ // The text's opening says what the open item is about, for a link to the pane.
88
+ usePaneShareItem(body ? () => ({ excerpt: shareItemExcerpt(body, { markdown: bodyFormat === "markdown" }) }) : null, { kit: true });
85
89
  return (
86
90
  <DetailScrollBody ref={ref} resetScrollKey={resetScrollKey}>
87
91
  {nativePaneChrome
@@ -20,6 +20,7 @@ import {
20
20
  tableColumnStarts,
21
21
  tableContentWidthProps,
22
22
  tableFarEdgePad,
23
+ tableFreezesFirstColumn,
23
24
  tableScrollStep,
24
25
  useMeasuredTableContentWidth,
25
26
  } from "../../table-layout";
@@ -131,7 +132,9 @@ function OpenTuiDataTableRowInner<
131
132
  flexDirection="row"
132
133
  height={1}
133
134
  {...tableContentWidthProps(contentWidth)}
134
- paddingX={horizontalPadding}
135
+ // Beside a pinned first column the heading stays in view too, not cut to its last letters.
136
+ paddingLeft={horizontalPadding + (frozenColumnOffset ?? 0)}
137
+ paddingRight={horizontalPadding}
135
138
  backgroundColor={selected ? colors.selected : sectionHeader.backgroundColor ?? colors.bg}
136
139
  onMouseDown={(event: any) => {
137
140
  focusPane();
@@ -310,7 +313,7 @@ export function OpenTuiDataTable<T, C extends DataTableColumn = DataTableColumn>
310
313
  horizontalPadding = 1,
311
314
  fillAvailableWidth = true,
312
315
  showHorizontalScrollbar = true,
313
- freezeFirstColumn = false,
316
+ freezeFirstColumn: freezeFirstColumnProp,
314
317
  scrollToIndex,
315
318
  scrollToIndexAlign = "nearest",
316
319
  scrollToIndexVersion = 0,
@@ -375,6 +378,10 @@ export function OpenTuiDataTable<T, C extends DataTableColumn = DataTableColumn>
375
378
  } = useMeasuredTableContentWidth(tableWidth, headerScrollRef, scrollRef);
376
379
  const horizontalScrollbarVisible = showHorizontalScrollbar
377
380
  && hasMeaningfulTableHorizontalOverflow(tableWidth, measuredViewportWidth, columnGap);
381
+ const freezeFirstColumn = tableFreezesFirstColumn({
382
+ freezeFirstColumn: freezeFirstColumnProp, columns, columnGap, horizontalPadding, viewportWidth: measuredViewportWidth,
383
+ overflows: horizontalScrollbarVisible,
384
+ });
378
385
  const contentWidth = fillAvailableWidth ? measuredContentWidth : tableWidth;
379
386
  const sectionWidth = measuredViewportWidth > 0 ? Math.min(contentWidth, measuredViewportWidth) : contentWidth;
380
387
  const displayColumns = useMemo(
@@ -390,7 +397,7 @@ export function OpenTuiDataTable<T, C extends DataTableColumn = DataTableColumn>
390
397
  const scrollContentWidth = contentWidth + (freezeFirstColumn && horizontalScrollbarVisible
391
398
  ? tableFarEdgePad({ columns: displayColumns, columnGap, horizontalPadding, contentWidth, viewportWidth: measuredViewportWidth })
392
399
  : 0);
393
- // Columns out of view past the right edge: the header row ends in "more →" there, a press on it scrolls to
400
+ // Columns out of view past the right edge: the header row ends in "more ⇧→" there, a press on it scrolls to
394
401
  // them, and the rows leave its cells blank, so a narrow pane says it has more than it shows. The header's
395
402
  // scroll box is as wide as the body's viewport (measuredViewportWidth), so the header row has a blank cell
396
403
  // past it, over the body's vertical scrollbar; the hint is laid over the row, not inside the scroll box,
@@ -488,7 +495,7 @@ export function OpenTuiDataTable<T, C extends DataTableColumn = DataTableColumn>
488
495
  scrollRef: headerScrollRef,
489
496
  onHorizontalScroll: syncBodyScroll,
490
497
  });
491
- // "more →" steps right as Shift+Right does: half the viewport (beside a frozen column, to a column's edge).
498
+ // "more ⇧→" steps right as Shift+Right does: half the viewport (beside a frozen column, to a column's edge).
492
499
  const scrollToMoreColumns = useCallback(() => {
493
500
  const body = scrollRef.current;
494
501
  const viewportWidth = body?.viewport?.width ?? 0;
@@ -90,11 +90,13 @@ export function reuseDataTableColumnClips(
90
90
  /**
91
91
  * What a table's header says at its right edge while columns are out of view
92
92
  * past it, longest first: the longest that fits beside the last column shown
93
- * whole is drawn. With that column against the edge, the arrow takes the
94
- * blank its label ends in. The hint never hides a column: with no blank to
95
- * take, the horizontal scrollbar is the only sign.
93
+ * whole is drawn. It names the key that scrolls there, Shift+Right in compact
94
+ * notation (`⇧→`): a plain Right switches a pane's tabs. With that column
95
+ * against the edge, the arrow takes the blank its label ends in. The hint
96
+ * never hides a column: with no blank to take, the horizontal scrollbar is
97
+ * the only sign.
96
98
  */
97
- const MORE_COLUMNS_LABELS = ["more →", "more", "→"] as const;
99
+ const MORE_COLUMNS_LABELS = ["more ⇧→", "⇧→", "→"] as const;
98
100
 
99
101
  export interface MoreColumnsHint {
100
102
  /** The cells the hint draws: its label, after a blank unless it takes the last column's own. */
@@ -128,7 +130,7 @@ function hasColumnsPastRightEdge(columns: readonly HintColumn[], starts: readonl
128
130
  }
129
131
 
130
132
  /**
131
- * The "more →" hint at the header's right edge while columns are out of view
133
+ * The "more ⇧→" hint at the header's right edge while columns are out of view
132
134
  * past it, or null. The header's scroll box is as wide as the viewport, and
133
135
  * `besideHeader` blank cells follow it on the header row (the cell over the
134
136
  * body's vertical scrollbar); the hint, laid over the row, can reach them.
@@ -193,7 +195,7 @@ export function resolveMoreColumnsHint({
193
195
  * Each column's clip at the current scroll, null for a column shown whole.
194
196
  * A frozen first column stays, and what slides under it counts as cut on the
195
197
  * left. `rightReserve` cells at the right edge show no column (under the
196
- * "more →" hint, `resolveMoreColumnsHint`). Null for the whole table when every column is whole or nothing is
198
+ * "more ⇧→" hint, `resolveMoreColumnsHint`). Null for the whole table when every column is whole or nothing is
197
199
  * measured yet.
198
200
  */
199
201
  export function resolveDataTableColumnClips({
@@ -175,7 +175,12 @@ export interface DataTableProps<
175
175
  horizontalPadding?: number;
176
176
  fillAvailableWidth?: boolean;
177
177
  showHorizontalScrollbar?: boolean;
178
- /** Keep the row identifier visible during horizontal scrolling. */
178
+ /**
179
+ * Keep the row identifier visible during horizontal scrolling. Unset, the
180
+ * first column is pinned while the table is too wide for its viewport and
181
+ * that column leaves the rest at least half of it (`tableFreezesFirstColumn`);
182
+ * `false` lets it scroll away.
183
+ */
179
184
  freezeFirstColumn?: boolean;
180
185
  /** Append export-only source records after the displayed table. */
181
186
  getExportMetadata?: () => readonly (readonly unknown[])[];
@@ -75,7 +75,7 @@ export { InlineQuickAddRow } from "./inline-quick-add";
75
75
  export type { InlineQuickAddRowProps } from "./inline-quick-add";
76
76
 
77
77
  export { ExternalLink, ExternalLinkText, openUrl, PaneLinkMenu, usePaneLinkMenuEntry } from "./external-link";
78
- export { DesktopPaneLinkChip, TerminalPaneLinkChip } from "./pane-link-chip";
78
+ export { DesktopPaneLinkChip, TerminalPaneLinkChip, TerminalPaneLinkItemCard, terminalItemCardRows } from "./pane-link-chip";
79
79
  export type { PaneLinkChipContent } from "./pane-link-chip";
80
80
  export { ButtonActionScope } from "./action-scope";
81
81
  export { RemoteImage } from "./remote-image";
@@ -2,6 +2,7 @@ import { Box, Text, TextAttributes, useUiHost } from "../../ui";
2
2
  import { useShortcut } from "../../react/input";
3
3
  import { useCallback, type ComponentType, type ReactNode } from "react";
4
4
  import { colors } from "../../theme/colors";
5
+ import { usePaneShareItem } from "../../shares/pane-item";
5
6
  import {
6
7
  isDetailBackNavigationKey,
7
8
  isMouseBackNavigationEvent,
@@ -31,6 +32,8 @@ export function PageStackView({
31
32
  backHint,
32
33
  }: PageStackViewProps) {
33
34
  const HostPageStackView = useUiHost().PageStackView as ComponentType<PageStackViewProps> | undefined;
35
+ // The open detail's title names what the pane is on, for a link to it.
36
+ usePaneShareItem(detailOpen && detailTitle ? { title: detailTitle } : null, { kit: true });
34
37
  const props = {
35
38
  focused,
36
39
  detailOpen,