@gloom-sh/terminal 0.19.6 → 0.20.1

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 (209) hide show
  1. package/LICENSE +0 -4
  2. package/package.json +6 -5
  3. package/patches/electrobun-devkit@2.0.5.patch +408 -0
  4. package/src/api-client/bond-trades.ts +59 -0
  5. package/src/api-client/crypto-markets.ts +20 -2
  6. package/src/api-client/data.ts +21 -0
  7. package/src/api-client/fund-facts.ts +23 -1
  8. package/src/api-client/index.ts +2 -0
  9. package/src/api-client/types/account.ts +86 -0
  10. package/src/api-client/types/assist.ts +32 -0
  11. package/src/api-client/types/auth.ts +63 -0
  12. package/src/api-client/types/billing.ts +54 -0
  13. package/src/api-client/types/chat.ts +180 -0
  14. package/src/api-client/types/congress.ts +107 -0
  15. package/src/api-client/types/credit.ts +110 -0
  16. package/src/api-client/types/econ.ts +158 -0
  17. package/src/api-client/types/equity-diagnostic.ts +73 -0
  18. package/src/api-client/types/filings-and-calls.ts +356 -0
  19. package/src/api-client/types/index.ts +25 -0
  20. package/src/api-client/types/jobs.ts +147 -0
  21. package/src/api-client/types/market.ts +122 -0
  22. package/src/api-client/types/news.ts +91 -0
  23. package/src/api-client/types/notes-and-theses.ts +172 -0
  24. package/src/api-client/types/quotes.ts +28 -0
  25. package/src/api-client/types/scanners.ts +125 -0
  26. package/src/api-client/types/screener.ts +65 -0
  27. package/src/api-client/types/search.ts +107 -0
  28. package/src/api-client/types/sync.ts +14 -0
  29. package/src/api-client/types/team-collections.ts +43 -0
  30. package/src/api-client/types/team-views.ts +32 -0
  31. package/src/api-client/types/teams.ts +135 -0
  32. package/src/api-client/types/ticker-data.ts +57 -0
  33. package/src/api-client/types/tweets.ts +59 -0
  34. package/src/api-client/types/world-venues.ts +23 -0
  35. package/src/app/runtime/desktop-deeplink.ts +41 -6
  36. package/src/app/runtime/plugin-seed.ts +119 -0
  37. package/src/app/runtime/startup.ts +45 -9
  38. package/src/app/star-prompt/status-line.tsx +1 -1
  39. package/src/app.tsx +2 -7
  40. package/src/architecture/ui-tokens-allowlist.json +0 -8
  41. package/src/cli/board-coins.ts +38 -5
  42. package/src/cli/commands/crypto-hints.ts +8 -1
  43. package/src/cli/commands/market.ts +29 -26
  44. package/src/cli/commands/overview.ts +13 -6
  45. package/src/cli/commands/ticker.ts +78 -18
  46. package/src/cli/company-name-hint.ts +19 -0
  47. package/src/cli/desktop-pane-shot-browser.ts +69 -3
  48. package/src/cli/entry.ts +10 -4
  49. package/src/cli/glossary.ts +25 -0
  50. package/src/cli/helpers.ts +4 -2
  51. package/src/cli/not-a-ticker.ts +26 -1
  52. package/src/cli/pane-functions/catalog.ts +3 -1
  53. package/src/cli/pane-functions/freshness.ts +45 -29
  54. package/src/cli/pane-functions/market-session.ts +14 -5
  55. package/src/cli/restore-plugins.ts +164 -51
  56. package/src/components/chart/composite/use-composite-chart-keyboard.ts +11 -2
  57. package/src/components/chart-table/header.tsx +10 -1
  58. package/src/components/chart-table/layout.ts +14 -5
  59. package/src/components/command-bar/panel/index.tsx +13 -0
  60. package/src/components/command-bar/panel/layout.ts +7 -0
  61. package/src/components/command-bar/panel/runtime.ts +1 -0
  62. package/src/components/command-bar/panel/types.ts +2 -0
  63. package/src/components/data-table/export.ts +4 -1
  64. package/src/components/layout/detached-pane-shell.tsx +10 -37
  65. package/src/components/layout/double-escape-close.ts +90 -0
  66. package/src/components/layout/header.tsx +3 -2
  67. package/src/components/layout/market-summary.ts +6 -3
  68. package/src/components/layout/pane/footer/index.tsx +2 -6
  69. package/src/components/layout/pane/footer/model.ts +6 -12
  70. package/src/components/layout/shell/active-drag.ts +53 -11
  71. package/src/components/layout/shell/drag/magnets.ts +128 -19
  72. package/src/components/layout/shell/pane/actions.ts +6 -2
  73. package/src/components/layout/shell/pane/management-shortcuts.ts +13 -51
  74. package/src/components/layout/status-bar.tsx +4 -78
  75. package/src/components/layout/status-widget-space.ts +5 -5
  76. package/src/components/onboarding/portfolio-step/positions-panel.tsx +1 -1
  77. package/src/components/ui/data-table/index.tsx +5 -1
  78. package/src/components/ui/data-table/render-cell.ts +19 -0
  79. package/src/components/ui/delayed-mark.tsx +59 -7
  80. package/src/components/ui/icon.tsx +1 -8
  81. package/src/components/ui/menu.tsx +6 -1
  82. package/src/i18n/es.ts +6 -3
  83. package/src/i18n/ja.ts +6 -3
  84. package/src/i18n/ko.ts +6 -3
  85. package/src/i18n/zh-cn.ts +6 -3
  86. package/src/i18n/zh-tw.ts +6 -3
  87. package/src/market-data/fund-facts.ts +7 -1
  88. package/src/market-data/market/change-basis.ts +20 -0
  89. package/src/market-data/market/format.ts +62 -2
  90. package/src/market-data/market/futures-week.ts +3 -1
  91. package/src/plugins/builtin/chart-composer/headless.ts +57 -17
  92. package/src/plugins/builtin/chart-composer/session-range.ts +82 -3
  93. package/src/plugins/builtin/chat/content/composer.tsx +21 -27
  94. package/src/plugins/builtin/chat/content/index.tsx +31 -3
  95. package/src/plugins/builtin/chat/content/shortcuts.ts +4 -2
  96. package/src/plugins/builtin/chat/content/snapshot.ts +0 -3
  97. package/src/plugins/builtin/cloud/auth-actions.tsx +51 -23
  98. package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +3 -3
  99. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +32 -25
  100. package/src/plugins/builtin/congress-trades/model.ts +2 -1
  101. package/src/plugins/builtin/congress-trades/pane.tsx +3 -0
  102. package/src/plugins/builtin/correlation/compute.ts +8 -2
  103. package/src/plugins/builtin/correlation/headless.ts +10 -9
  104. package/src/plugins/builtin/correlation/history.ts +30 -0
  105. package/src/plugins/builtin/correlation/matrix/model.ts +10 -10
  106. package/src/plugins/builtin/correlation/relationship/model.ts +3 -6
  107. package/src/plugins/builtin/correlation/relationship/pane.tsx +1 -2
  108. package/src/plugins/builtin/crypto-board/client.ts +6 -1
  109. package/src/plugins/builtin/crypto-board/defi-view.tsx +12 -1
  110. package/src/plugins/builtin/crypto-board/defi.ts +44 -7
  111. package/src/plugins/builtin/crypto-board/headless.ts +83 -12
  112. package/src/plugins/builtin/crypto-board/model.ts +30 -6
  113. package/src/plugins/builtin/crypto-board/pane.tsx +13 -2
  114. package/src/plugins/builtin/custom-view/index.tsx +1 -1
  115. package/src/plugins/builtin/custom-view/loader.ts +85 -8
  116. package/src/plugins/builtin/custom-view/view-spec.ts +28 -0
  117. package/src/plugins/builtin/equity-screener/criterion-editor.tsx +13 -4
  118. package/src/plugins/builtin/equity-screener/headless.ts +33 -1
  119. package/src/plugins/builtin/equity-screener/model.ts +58 -15
  120. package/src/plugins/builtin/equity-screener/pane.tsx +36 -6
  121. package/src/plugins/builtin/executives/format.ts +5 -4
  122. package/src/plugins/builtin/executives/pane.tsx +1 -1
  123. package/src/plugins/builtin/help/index.tsx +55 -1
  124. package/src/plugins/builtin/insider/model.ts +30 -2
  125. package/src/plugins/builtin/jobs/model.ts +2 -2
  126. package/src/plugins/builtin/mna/model.ts +2 -2
  127. package/src/plugins/builtin/notes/files.ts +2 -0
  128. package/src/plugins/builtin/notes/owner.tsx +20 -1
  129. package/src/plugins/builtin/notes/quick-notes-pane.tsx +22 -4
  130. package/src/plugins/builtin/notes/store.ts +6 -1
  131. package/src/plugins/builtin/perps/headless.ts +8 -2
  132. package/src/plugins/builtin/portfolio-list/header.tsx +1 -1
  133. package/src/plugins/builtin/research/corporate-actions-pane.tsx +29 -25
  134. package/src/plugins/builtin/risk-factors/index.tsx +2 -28
  135. package/src/plugins/builtin/risk-factors/lock-note.ts +58 -0
  136. package/src/plugins/builtin/risk-factors/pane.tsx +10 -3
  137. package/src/plugins/builtin/scanner/hilo-model.ts +4 -3
  138. package/src/plugins/builtin/sec/fund-facts.ts +45 -11
  139. package/src/plugins/builtin/sec/headless.ts +30 -1
  140. package/src/plugins/builtin/sec/index.tsx +26 -5
  141. package/src/plugins/builtin/series-inventory.ts +1 -0
  142. package/src/plugins/builtin/shared/earnings-report.ts +7 -2
  143. package/src/plugins/builtin/shared/pro-lock-note.ts +5 -1
  144. package/src/plugins/builtin/shared/use-quote-board.ts +85 -46
  145. package/src/plugins/builtin/short-interest/headless.ts +1 -1
  146. package/src/plugins/builtin/short-interest/model.ts +15 -6
  147. package/src/plugins/builtin/short-interest/types.ts +2 -0
  148. package/src/plugins/builtin/thirteenf/overlap-pane.tsx +3 -0
  149. package/src/plugins/builtin/thirteenf/pane.tsx +3 -0
  150. package/src/plugins/builtin/ticker-detail/overview/model.ts +19 -9
  151. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +4 -4
  152. package/src/plugins/builtin/time-sales/headless.ts +23 -7
  153. package/src/plugins/builtin/time-sales/index.tsx +2 -2
  154. package/src/plugins/builtin/trace-bonds/detail.tsx +198 -0
  155. package/src/plugins/builtin/trace-bonds/headless.ts +62 -4
  156. package/src/plugins/builtin/trace-bonds/history.ts +155 -0
  157. package/src/plugins/builtin/trace-bonds/pane.tsx +64 -5
  158. package/src/plugins/extracted-plugins.ts +49 -24
  159. package/src/plugins/installer.ts +234 -32
  160. package/src/plugins/plugin-names.ts +11 -2
  161. package/src/plugins/running-installs.ts +34 -0
  162. package/src/plugins/seed-progress.ts +72 -0
  163. package/src/remote/controller.ts +9 -2
  164. package/src/remote/schema.ts +2 -1
  165. package/src/renderers/cloudflare/http-proxy.ts +67 -8
  166. package/src/renderers/cloudflare/proxy-session.ts +1 -1
  167. package/src/renderers/cloudflare/worker.ts +29 -2
  168. package/src/renderers/dom/desktop/icons.tsx +0 -2
  169. package/src/renderers/dom/styles.css +0 -3
  170. package/src/renderers/electrobun/bun/desktop/backend.ts +14 -0
  171. package/src/renderers/electrobun/bun/desktop/host-requests.ts +14 -7
  172. package/src/renderers/electrobun/bun/desktop/initialization.ts +24 -14
  173. package/src/renderers/electrobun/bun/desktop/install-records.ts +59 -0
  174. package/src/renderers/electrobun/bun/desktop/installer-folder.ts +208 -592
  175. package/src/renderers/electrobun/bun/desktop/macos-objc.ts +14 -0
  176. package/src/renderers/electrobun/bun/desktop/update.ts +1 -1
  177. package/src/renderers/electrobun/bun/index.ts +24 -13
  178. package/src/renderers/electrobun/bun/window/context-menu-thread.ts +84 -0
  179. package/src/renderers/electrobun/bun/window/create.ts +23 -3
  180. package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +4 -4
  181. package/src/renderers/electrobun/bun/window/events.ts +4 -4
  182. package/src/renderers/electrobun/bun/window/frame.ts +2 -1
  183. package/src/renderers/electrobun/bun/window/native-call-thread.ts +224 -0
  184. package/src/renderers/electrobun/bun/window/native-min-size.ts +322 -0
  185. package/src/renderers/electrobun/bun/window/native-timing.ts +10 -0
  186. package/src/renderers/electrobun/bun/window/script-for-webview.ts +15 -0
  187. package/src/renderers/electrobun/bun/window/webview-script-thread.ts +82 -0
  188. package/src/renderers/electrobun/shared/protocol.ts +13 -2
  189. package/src/renderers/electrobun/view/backend-rpc.ts +8 -1
  190. package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +1 -1
  191. package/src/renderers/electrobun/view/main.tsx +4 -3
  192. package/src/renderers/opentui/start.tsx +3 -0
  193. package/src/sources/gloomberb-cloud/index.ts +5 -7
  194. package/src/sources/provider-router/batches.ts +18 -3
  195. package/src/sources/provider-router/financials.ts +18 -4
  196. package/src/telemetry/stall-reports.ts +21 -4
  197. package/src/types/data-provider.ts +14 -0
  198. package/src/types/financials.ts +15 -3
  199. package/src/types/headless.ts +2 -0
  200. package/src/utils/double-escape-close.ts +38 -16
  201. package/src/utils/format.ts +23 -3
  202. package/src/utils/main-thread-stall.ts +21 -5
  203. package/src/utils/perf-marks.ts +88 -9
  204. package/src/utils/price-earnings.ts +18 -0
  205. package/src/utils/reported-money.ts +9 -2
  206. package/src/utils/sec.ts +34 -3
  207. package/patches/electrobun@1.18.1.patch +0 -633
  208. package/src/api-client/types.ts +0 -2441
  209. package/src/plugins/seed-notice.ts +0 -20
@@ -21,6 +21,7 @@ import {
21
21
  hasPaneTableExporter,
22
22
  } from "../../../../state/pane-table-export-registry";
23
23
  import { getDesktopWindows } from "../../../../state/desktop-windows";
24
+ import { getTopFloatingPaneId } from "../../../../core/state/app/layout";
24
25
 
25
26
  function notifyPaneLocked(pluginRegistry: PluginRegistry): void {
26
27
  pluginRegistry.notify({ body: "Pane is locked. Unlock it in pane settings.", type: "info" });
@@ -125,7 +126,7 @@ export function useShellPaneActions({
125
126
  return true;
126
127
  }, [canExportPaneCsv, exportPaneCsv, focusedPaneId]);
127
128
 
128
- const closeFocusedPane = useCallback(() => {
129
+ const closeFocusedPane = useCallback(({ focusNextFloating = false }: { focusNextFloating?: boolean } = {}) => {
129
130
  if (!focusedPaneId || !isPaneInLayout(visibleLayout, focusedPaneId)) return false;
130
131
  if (isPaneLockedInLayout(visibleLayout, focusedPaneId)) {
131
132
  notifyPaneLocked(pluginRegistry);
@@ -133,7 +134,10 @@ export function useShellPaneActions({
133
134
  return true;
134
135
  }
135
136
  const nextLayout = removePane(visibleLayout, focusedPaneId);
136
- persistLayout(nextLayout, removedFocusRestoreOptions(nextLayout, focusedPaneId, previousFocusedPaneId));
137
+ const nextFloatingPaneId = focusNextFloating ? getTopFloatingPaneId(nextLayout) : null;
138
+ persistLayout(nextLayout, nextFloatingPaneId
139
+ ? { focusedPaneId: nextFloatingPaneId }
140
+ : removedFocusRestoreOptions(nextLayout, focusedPaneId, previousFocusedPaneId));
137
141
  return true;
138
142
  }, [focusedPaneId, persistLayout, pluginRegistry, previousFocusedPaneId, visibleLayout]);
139
143
 
@@ -1,15 +1,9 @@
1
- import { useEffect, useRef, useState } from "react";
1
+ import { useState } from "react";
2
2
  import { useShortcut } from "../../../../react/input";
3
3
  import { useKeybindings } from "../../../../app/keybindings";
4
4
  import type { WindowEditMode } from "../../../../plugins/registry";
5
- import {
6
- armDoubleEscapeClose,
7
- createDoubleEscapeCloseState,
8
- offerEscapeTowardClose,
9
- resetDoubleEscapeClose,
10
- takeDoubleEscapeClose,
11
- } from "../../../../utils/double-escape-close";
12
5
  import { createOneShots } from "../../../../utils/one-shot";
6
+ import { useDoubleEscapeClose } from "../../double-escape-close";
13
7
  import {
14
8
  inputCaptureAllowsPaneManagementShortcut,
15
9
  resolvePaneManagementShortcut,
@@ -19,7 +13,8 @@ interface ShellPaneManagementShortcutOptions {
19
13
  askAboutFocusedPane(): boolean;
20
14
  cancelActiveDrag(): void;
21
15
  closeAllFloatingPanes(): boolean;
22
- closeFocusedPane(): boolean;
16
+ /** `focusNextFloating`: the top floating pane left takes the focus, for closing them one after another. */
17
+ closeFocusedPane(options?: { focusNextFloating?: boolean }): boolean;
23
18
  copyFocusedPaneScreenshot(): boolean;
24
19
  exportFocusedPaneCsv(): boolean;
25
20
  focusedPaneId: string | null;
@@ -60,16 +55,18 @@ export function useShellPaneManagementShortcuts({
60
55
  toggleFocusedPaneFloating,
61
56
  toggleFocusedPaneNewLayout,
62
57
  }: ShellPaneManagementShortcutOptions): void {
63
- const doubleEscapeCloseRef = useRef(createDoubleEscapeCloseState());
64
58
  // A key held down, or a trigger with no repeat flag, runs each action once.
65
59
  const [shots] = useState(createOneShots);
66
60
  const keybindings = useKeybindings();
67
61
 
68
- useEffect(() => {
69
- if (overlayOpen) {
70
- resetDoubleEscapeClose(doubleEscapeCloseRef.current);
71
- }
72
- }, [overlayOpen]);
62
+ // Esc Esc closes the focused pane and hands the focus to the next floating one.
63
+ useDoubleEscapeClose({
64
+ targetId: focusedPaneId,
65
+ overlayOpen,
66
+ editing: inputCaptured,
67
+ dragging: hasActiveDrag,
68
+ close: () => closeFocusedPane({ focusNextFloating: true }),
69
+ });
73
70
 
74
71
  useShortcut((event) => {
75
72
  const shortcut = resolvePaneManagementShortcut(event, keybindings);
@@ -105,7 +102,6 @@ export function useShellPaneManagementShortcuts({
105
102
  }
106
103
  if (askAboutFocusedPane()) {
107
104
  shots.get(shortcut).end();
108
- resetDoubleEscapeClose(doubleEscapeCloseRef.current);
109
105
  event.preventDefault();
110
106
  event.stopPropagation();
111
107
  return;
@@ -113,47 +109,13 @@ export function useShellPaneManagementShortcuts({
113
109
  }
114
110
  }
115
111
 
116
- const isEscape = event.name === "escape" || event.name === "esc";
117
- if (isEscape) {
118
- const doubleEscapeState = doubleEscapeCloseRef.current;
119
- if (!hasActiveDrag() && !overlayOpen) {
120
- if (takeDoubleEscapeClose(doubleEscapeState, focusedPaneId, Date.now()) && closeFocusedPane()) {
121
- event.preventDefault();
122
- event.stopPropagation();
123
- return;
124
- }
125
- } else {
126
- resetDoubleEscapeClose(doubleEscapeState);
127
- }
128
-
129
- if (!hasActiveDrag()) return;
112
+ if ((event.name === "escape" || event.name === "esc") && hasActiveDrag()) {
130
113
  cancelActiveDrag();
131
114
  event.preventDefault();
132
115
  event.stopPropagation();
133
- } else {
134
- resetDoubleEscapeClose(doubleEscapeCloseRef.current);
135
116
  }
136
117
  }, { phase: "before" });
137
118
 
138
- const armDoubleEscape = () => {
139
- armDoubleEscapeClose(doubleEscapeCloseRef.current, focusedPaneId, Date.now());
140
- };
141
-
142
- // A pane that uses an Esc to leave an empty field may still count it.
143
- useShortcut((event) => {
144
- if (event.name !== "escape" && event.name !== "esc") return;
145
- if (hasActiveDrag() || overlayOpen) return;
146
- offerEscapeTowardClose(event, armDoubleEscape);
147
- }, { phase: "before", allowEditable: true });
148
-
149
- // Only an Esc nothing else used arms the close, including a footer's Esc
150
- // hint: the idle phase runs last and never sees a key a handler consumed.
151
- useShortcut((event) => {
152
- if (event.name !== "escape" && event.name !== "esc") return;
153
- if (hasActiveDrag() || overlayOpen) return;
154
- armDoubleEscape();
155
- }, { phase: "idle" });
156
-
157
119
  // The pane menu key is a fallback too: a pane that binds "." keeps it,
158
120
  // however late it mounted.
159
121
  useShortcut((event) => {
@@ -3,7 +3,6 @@ import {
3
3
  Text,
4
4
  contextMenuDivider,
5
5
  useContextMenu,
6
- useRendererHost,
7
6
  useUiCapabilities,
8
7
  useUiHost,
9
8
  } from "../../ui";
@@ -28,7 +27,6 @@ import {
28
27
  type ShortcutDisplayMode,
29
28
  type ShortcutPlatform,
30
29
  } from "../../utils/shortcut-labels";
31
- import { getCurrentPluginTarget } from "../../plugins/current-target";
32
30
  import { getSharedRegistry } from "../../plugins/registry";
33
31
  import {
34
32
  shouldShowTidyWindows,
@@ -36,7 +34,6 @@ import {
36
34
  } from "../../layout/pane-manager";
37
35
  import { PluginSlot } from "../../react/plugins/plugin-slot";
38
36
  import type { ContextMenuItem } from "../../types/context-menu";
39
- import { VERSION } from "../../version";
40
37
  import { displayWidth } from "../../utils/format";
41
38
  import { Button } from "../ui/button";
42
39
  import { confirmDialog } from "../ui/confirm-dialog";
@@ -64,12 +61,6 @@ type StatusBarEvent = { stopPropagation?: () => void; preventDefault?: () => voi
64
61
  type HoveredControl = string | null;
65
62
  type SetHoveredControl = (updater: (current: HoveredControl) => HoveredControl) => void;
66
63
 
67
- /**
68
- * Where term.gloom.sh sends people who want the installed app. The route
69
- * picks the installer for the visitor's OS, so one link serves every platform.
70
- */
71
- const DESKTOP_DOWNLOAD_URL = "https://gloom.sh/download/desktop";
72
-
73
64
  /**
74
65
  * The note while the data service gives no answer at all, and its short form
75
66
  * for a narrow terminal. Every pane's own failure says why; this says once,
@@ -97,9 +88,7 @@ type StatusBarViewProps = {
97
88
  hoveredControl: HoveredControl;
98
89
  layoutTabItems: LayoutTabItem[];
99
90
  layoutTabsWidth: number;
100
- openChangelog?: (event?: StatusBarEvent) => void;
101
91
  openLayoutContextMenu: (index: number, event: any) => void | Promise<unknown>;
102
- rightAvailableWidth: number;
103
92
  /** The connection note to show (CONNECTION_NOTE or its short form), or null while the data service answers. */
104
93
  connectionNote: string | null;
105
94
  openConnections: () => void;
@@ -153,7 +142,7 @@ const openNewLayout = (event?: StatusBarEvent) => {
153
142
 
154
143
  const TERMINAL_NEW_LAYOUT_LABEL = " + ";
155
144
 
156
- export function StatusBar({ onOpenChangelog }: { onOpenChangelog?: (version: string) => void } = {}) {
145
+ export function StatusBar() {
157
146
  const { nativePaneChrome, nativeContextMenu } = useUiCapabilities();
158
147
  const { showContextMenu } = useContextMenu();
159
148
  const dialog = useDialog();
@@ -293,12 +282,6 @@ export function StatusBar({ onOpenChangelog }: { onOpenChangelog?: (version: str
293
282
  });
294
283
  };
295
284
 
296
- const openChangelog = (event?: StatusBarEvent) => {
297
- event?.preventDefault?.();
298
- event?.stopPropagation?.();
299
- onOpenChangelog?.(VERSION);
300
- };
301
-
302
285
  const requestDeleteLayout = useCallback(async (index: number) => {
303
286
  const layout = layouts[index];
304
287
  if (!layout || layouts.length <= 1) return;
@@ -458,13 +441,12 @@ export function StatusBar({ onOpenChangelog }: { onOpenChangelog?: (version: str
458
441
  if (!statusBarVisible) return null;
459
442
 
460
443
  // Feedback keeps the bottom-right corner; the connection note comes before
461
- // the version chip, which gives way first, also to a widget that claimed
462
- // more than the usual room. A narrow terminal shortens the note.
444
+ // the widgets and gives way to a widget that claimed more than the usual
445
+ // room. A narrow terminal shortens the note.
463
446
  const rightWidth = Math.max(0, termWidth - leftWidth - STATUS_WIDGET_COLUMNS - claimedWidgetColumns - feedbackWidth);
464
447
  const connectionNote = !dataServiceUnreachable ? null
465
448
  : nativePaneChrome || rightWidth >= displayWidth(t(CONNECTION_NOTE)) + 1 ? CONNECTION_NOTE
466
449
  : rightWidth >= displayWidth(t(CONNECTION_NOTE_SHORT)) + 1 ? CONNECTION_NOTE_SHORT : null;
467
- const connectionNoteWidth = connectionNote && !nativePaneChrome ? displayWidth(t(connectionNote)) + 1 : 0;
468
450
 
469
451
  const viewProps: StatusBarViewProps = {
470
452
  activeLayoutIdx,
@@ -476,9 +458,7 @@ export function StatusBar({ onOpenChangelog }: { onOpenChangelog?: (version: str
476
458
  hoveredControl,
477
459
  layoutTabItems,
478
460
  layoutTabsWidth: tabsWidth,
479
- openChangelog: onOpenChangelog ? openChangelog : undefined,
480
461
  openLayoutContextMenu,
481
- rightAvailableWidth: Math.max(0, rightWidth - connectionNoteWidth),
482
462
  connectionNote,
483
463
  openConnections,
484
464
  setHoveredControl,
@@ -518,7 +498,6 @@ function NativeStatusBar({
518
498
  {showTidyWindows && <NativeTidyWindows {...props} />}
519
499
  <Box flexGrow={1} minWidth={0} />
520
500
  <StatusBarConnectionNote nativePaneChrome {...props} />
521
- <StatusBarSummary nativePaneChrome {...props} />
522
501
  {/* Widgets keep their width; the layout tabs give way instead. */}
523
502
  <Box flexShrink={0} flexDirection="row" alignItems="center" data-gloom-role="status-widgets">
524
503
  <PluginSlot name="status:widget" />
@@ -551,7 +530,6 @@ function TerminalStatusBar({
551
530
  {showTidyWindows && <TerminalTidyWindows {...props} />}
552
531
  <Box flexGrow={1} minWidth={0} />
553
532
  <StatusBarConnectionNote nativePaneChrome={false} {...props} />
554
- <StatusBarSummary nativePaneChrome={false} {...props} />
555
533
  <StarPromptStatusLine />
556
534
  <PluginSlot name="status:widget" />
557
535
  <StatusBarFeedback nativePaneChrome={false} {...props} />
@@ -602,58 +580,6 @@ function StatusBarLayoutControl({
602
580
  );
603
581
  }
604
582
 
605
- /**
606
- * The version chip and, on the hosted web app, a link to the desktop app.
607
- * The link goes first when the row runs out of room, then the version. Live
608
- * market status lives at the header's right edge, not here, so nothing in the
609
- * status bar repeats it.
610
- */
611
- function StatusBarSummary({
612
- hoveredControl,
613
- nativePaneChrome,
614
- openChangelog,
615
- rightAvailableWidth,
616
- setHoveredControl,
617
- }: Pick<
618
- StatusBarViewProps,
619
- "hoveredControl" | "openChangelog" | "rightAvailableWidth" | "setHoveredControl"
620
- > & { nativePaneChrome: boolean }) {
621
- const rendererHost = useRendererHost();
622
- const versionLabel = `v${VERSION}`;
623
- const downloadLabel = t("Download desktop app");
624
- const showVersion = rightAvailableWidth >= versionLabel.length + 1;
625
- const showDownload = getCurrentPluginTarget() === "web"
626
- && rightAvailableWidth >= versionLabel.length + 1 + downloadLabel.length + 1;
627
- if (!showVersion) return null;
628
- return (
629
- <>
630
- <StatusBarChip
631
- hoveredControl={hoveredControl}
632
- id="version"
633
- label={versionLabel}
634
- nativePaneChrome={nativePaneChrome}
635
- onPress={openChangelog}
636
- role="button"
637
- setHoveredControl={setHoveredControl}
638
- // CHG opens the same notes from the command bar, where the keyboard can reach them.
639
- title={openChangelog ? `${tf("Open changelog for {version}", { version: versionLabel })} (CHG)` : undefined}
640
- />
641
- {showDownload && (
642
- <StatusBarChip
643
- hoveredControl={hoveredControl}
644
- id="desktop-download"
645
- label={downloadLabel}
646
- nativePaneChrome={nativePaneChrome}
647
- onPress={() => { void rendererHost.openExternal(DESKTOP_DOWNLOAD_URL); }}
648
- role="link"
649
- setHoveredControl={setHoveredControl}
650
- title={t("Get Gloom for Mac or Windows")}
651
- />
652
- )}
653
- </>
654
- );
655
- }
656
-
657
583
  /**
658
584
  * Says the data service is unreachable while it is, in the warning tone a
659
585
  * pane footer gives a failure; it opens Connections, which has the detail.
@@ -720,7 +646,7 @@ function StatusBarChip({
720
646
  label: string;
721
647
  nativePaneChrome: boolean;
722
648
  onPress?: (event?: StatusBarEvent) => void;
723
- role: "button" | "link";
649
+ role: "button";
724
650
  title?: string;
725
651
  tone?: "warning";
726
652
  }) {
@@ -3,9 +3,9 @@ import { useEffect, useSyncExternalStore } from "react";
3
3
  /**
4
4
  * Space in the status bar for the `status:widget` slot. The bar holds back a
5
5
  * fixed number of columns for its widgets; a widget that needs more claims
6
- * the extra here, so the version chip and the desktop link give way to it,
7
- * and reads how many columns the widgets have once they have, so it can
8
- * render nothing rather than run into its neighbours.
6
+ * the extra here, so the connection note gives way to it, and reads how many
7
+ * columns the widgets have once they have, so it can render nothing rather
8
+ * than run into its neighbours.
9
9
  */
10
10
  /** Held back for the widgets whether or not they claim more. */
11
11
  export const STATUS_WIDGET_COLUMNS = 20;
@@ -38,8 +38,8 @@ export function useClaimedStatusWidgetColumns(): number {
38
38
 
39
39
  /**
40
40
  * Publishes the columns the widgets can use: right of the layout controls,
41
- * less Feedback, before the version chip and the desktop link. Infinite while
42
- * no status bar is mounted, as in isolated renders.
41
+ * less Feedback. Infinite while no status bar is mounted, as in isolated
42
+ * renders.
43
43
  */
44
44
  export function usePublishStatusWidgetRoom(columns: number): void {
45
45
  useEffect(() => {
@@ -49,7 +49,7 @@ function fieldPlaceholder(field: PositionFieldId, state: OnboardingPositionsStat
49
49
  /** Company name and last price for the symbol being typed, or why it will not resolve. */
50
50
  function PreviewLine({ preview, error }: Pick<OnboardingPositionsState, "preview" | "error">) {
51
51
  const colors = useThemeColors();
52
- // Signed out or free, the price is the delayed one, and says so.
52
+ // Signed out or free, the price is the delayed one, and says so: setup covers the status bar's note.
53
53
  const delay = useFreeQuoteDelay(preview.status === "ready" ? preview.quote : null);
54
54
  if (error) return <Text fg={colors.negative} wrapText>{error}</Text>;
55
55
  if (preview.status === "idle") return null;
@@ -11,6 +11,7 @@ import { useOptionalPaneInstanceId } from "../../../state/app/context";
11
11
  import { registerPaneTableExporter } from "../../../state/pane-table-export-registry";
12
12
  import { createDataTableCsv } from "../../data-table/export";
13
13
  import { headerCase } from "../header-case";
14
+ import { figureColumnCells } from "./render-cell";
14
15
 
15
16
  export type {
16
17
  DataTableCell,
@@ -21,8 +22,11 @@ export type {
21
22
  } from "./types";
22
23
 
23
24
  export function DataTable<T, C extends DataTableColumn = DataTableColumn>(
24
- props: DataTableProps<T, C>,
25
+ ownProps: DataTableProps<T, C>,
25
26
  ) {
27
+ // Every renderer, report and export reads the cells through this, so a column of figures lines up everywhere.
28
+ const renderCell = useMemo(() => figureColumnCells(ownProps.renderCell), [ownProps.renderCell]);
29
+ const props = { ...ownProps, renderCell };
26
30
  const paneId = useOptionalPaneInstanceId();
27
31
  const renderer = useRendererHost();
28
32
  const propsRef = useRef(props);
@@ -0,0 +1,19 @@
1
+ import { displayWidth, inFigureColumn } from "../../../utils/format";
2
+ import type { DataTableColumn, DataTableProps } from "./types";
3
+
4
+ type RenderCell<T, C extends DataTableColumn> = DataTableProps<T, C>["renderCell"];
5
+
6
+ /**
7
+ * A table's cells as it draws, reports and exports them. A right-aligned
8
+ * column is a column of figures, so its compact numbers keep their decimals
9
+ * and line up (`inFigureColumn`): 12.00M over 10.73M, never 12M. A pane that
10
+ * sized the column to the short figures keeps the short one wherever the
11
+ * decimals would not fit, so a figure is never cut for them.
12
+ */
13
+ export function figureColumnCells<T, C extends DataTableColumn>(renderCell: RenderCell<T, C>): RenderCell<T, C> {
14
+ return (item, column, index, rowState) => {
15
+ if (column.align !== "right") return renderCell(item, column, index, rowState);
16
+ const cell = inFigureColumn(() => renderCell(item, column, index, rowState));
17
+ return displayWidth(cell.text) > column.width ? renderCell(item, column, index, rowState) : cell;
18
+ };
19
+ }
@@ -1,7 +1,9 @@
1
+ import { useEffect, useSyncExternalStore } from "react";
1
2
  import { Box, Text, useUiCapabilities } from "../../ui";
2
3
  import { useThemeColors } from "../../theme/theme-context";
3
4
  import { tf } from "../../i18n";
4
5
  import { displayWidth } from "../../utils/format";
6
+ import { useFreeQuoteDelay, type QuoteDelayFacts } from "../../api-client/plan-access";
5
7
  import { ICON_GLYPHS, Icon } from "./icon";
6
8
 
7
9
  /** The terminal's form of the mark: the clock and the delay, as the pane footer draws it (`◷15m`). */
@@ -23,13 +25,63 @@ export function delayedMarkWidth(minutes: number, nativePaneChrome: boolean): nu
23
25
  }
24
26
 
25
27
  /**
26
- * The one mark for a price shown late, beside the price: what the pane
27
- * footer's clock is for a pane's data (`delayedFooterSegment`), for a price
28
- * outside a footer (the header's SPY, the status bar, a quote's headline).
29
- * It reads without hovering: a yellow clock and the delay (`15m`) in the dim
30
- * tone of the meta text around it on the desktop and the web, `◷15m` in the
31
- * terminal, with `15m delayed` in its tooltip. Callers decide when a price is
32
- * late with `freeQuoteDelayMinutes` (or `useFreeQuoteDelay`); it draws nothing else.
28
+ * How many status bar notes say, for the whole app, that this account's
29
+ * prices are late. Counted rather than flagged so a note leaving as another
30
+ * arrives never clears it.
31
+ */
32
+ let statedCount = 0;
33
+ const statedListeners = new Set<() => void>();
34
+
35
+ function subscribeStated(listener: () => void): () => void {
36
+ statedListeners.add(listener);
37
+ return () => {
38
+ statedListeners.delete(listener);
39
+ };
40
+ }
41
+
42
+ function quoteDelayStated(): boolean {
43
+ return statedCount > 0;
44
+ }
45
+
46
+ /**
47
+ * For the status bar's delayed note: while `stating`, the app's prices are
48
+ * said to be late once for the whole screen, so a price outside a pane
49
+ * footer leaves its own mark out (`useDelayedMarkMinutes`).
50
+ */
51
+ export function useStateQuoteDelay(stating: boolean): void {
52
+ useEffect(() => {
53
+ if (!stating) return;
54
+ statedCount += 1;
55
+ for (const listener of statedListeners) listener();
56
+ return () => {
57
+ statedCount -= 1;
58
+ for (const listener of statedListeners) listener();
59
+ };
60
+ }, [stating]);
61
+ }
62
+
63
+ /**
64
+ * The delay to mark beside a price shown outside a pane footer (the header's
65
+ * SPY, a quote's headline): this account's (`useFreeQuoteDelay`) while
66
+ * nothing else on screen says it, null while the price is live or the status
67
+ * bar's delayed note says it for the whole app. The delay is said once per
68
+ * screen: with the status bar hidden (presentation mode, `SB`), or in a
69
+ * capture of the pane alone, the price carries the mark itself.
70
+ */
71
+ export function useDelayedMarkMinutes(quote: QuoteDelayFacts | null | undefined): number | null {
72
+ const minutes = useFreeQuoteDelay(quote);
73
+ const stated = useSyncExternalStore(subscribeStated, quoteDelayStated, quoteDelayStated);
74
+ return stated ? null : minutes;
75
+ }
76
+
77
+ /**
78
+ * The one mark for a price shown late: what the pane footer's clock is for a
79
+ * pane's data (`delayedFooterSegment`), for the status bar's delayed note and
80
+ * for a price outside a footer where nothing else on screen says the delay
81
+ * (`useDelayedMarkMinutes`). It reads without hovering: a yellow clock and the
82
+ * delay (`15m`) in the dim tone of the meta text around it on the desktop and
83
+ * the web, `◷15m` in the terminal, with `15m delayed` in its tooltip. It draws
84
+ * nothing else.
33
85
  */
34
86
  export function DelayedMark({ minutes }: { minutes: number }) {
35
87
  const colors = useThemeColors();
@@ -138,11 +138,6 @@ export interface IconButtonProps {
138
138
  size?: number;
139
139
  /** Keep the press from also reaching a row or header behind the button. */
140
140
  stopPropagation?: boolean;
141
- /**
142
- * A few characters after the icon, in a muted tone, for a status that must
143
- * read without hovering (a delay's `15m`). The label stays the accessible name.
144
- */
145
- text?: string;
146
141
  }
147
142
 
148
143
  /**
@@ -162,7 +157,6 @@ export function IconButton({
162
157
  disabled = false,
163
158
  size = 12,
164
159
  stopPropagation = true,
165
- text,
166
160
  }: IconButtonProps) {
167
161
  const colors = useThemeColors();
168
162
  const label = t(rawLabel);
@@ -188,7 +182,6 @@ export function IconButton({
188
182
  disabled={disabled}
189
183
  size={size}
190
184
  stopPropagation={stopPropagation}
191
- text={text}
192
185
  />
193
186
  );
194
187
  }
@@ -208,7 +201,7 @@ export function IconButton({
208
201
  >
209
202
  {/* Pressed takes the colour the desktop and the terminal pane header give an active toggle. */}
210
203
  <Text fg={disabled ? colors.textMuted : color ?? (pressed ? colors.warning : colors.textDim)} selectable={false}>
211
- {` ${ICON_GLYPHS[icon]}${text ?? ""} `}
204
+ {` ${ICON_GLYPHS[icon]} `}
212
205
  </Text>
213
206
  </Box>
214
207
  );
@@ -2,6 +2,7 @@ import { useMemo, useState, type ComponentType, type ReactNode } from "react";
2
2
  import { Box, Text, TextAttributes, useUiHost, type HostMenuProps, type HostMenuItem } from "../../ui";
3
3
  import { useThemeColors } from "../../theme/theme-context";
4
4
  import { useShortcut } from "../../react/input";
5
+ import { keepEscapeFromClosing } from "../../utils/double-escape-close";
5
6
  import { useRemoteUiNode } from "../../remote/semantic-tree";
6
7
  import { Popover } from "./popover";
7
8
 
@@ -59,7 +60,11 @@ function TerminalMenu({ items, onSelect, selection = "none", title, onClose }: M
59
60
  else if (key === "home" || key === "pageup") setHighlighted(enabled[0]?.id ?? null);
60
61
  else if (key === "end" || key === "pagedown") setHighlighted(enabled[enabled.length - 1]?.id ?? null);
61
62
  else if ((key === "return" || key === "enter" || key === "space") && highlighted) choose(highlighted);
62
- else if (key === "escape") onClose?.();
63
+ else if (key === "escape") {
64
+ // Closing the menu is not half of closing the pane under it.
65
+ keepEscapeFromClosing(event);
66
+ onClose?.();
67
+ }
63
68
  else return;
64
69
  event.preventDefault();
65
70
  event.stopPropagation();
package/src/i18n/es.ts CHANGED
@@ -285,6 +285,8 @@ export const es: Record<string, string> = {
285
285
 
286
286
  // ── Context menu ─────────────────────────────────────────────
287
287
  "Start Here": "Empieza aquí",
288
+ "About": "Acerca de",
289
+ "What's new in v{version}": "Novedades de la v{version}",
288
290
  "Research a company: the overview, then tabs for the chart, financials, news, filings and earnings calls.": "Investiga una empresa: el resumen y luego pestañas de gráfico, finanzas, noticias, presentaciones y llamadas de resultados.",
289
291
  "Add what you own. Alerts and emails then follow your portfolio.": "Añade lo que tienes. Las alertas y los correos seguirán tu cartera.",
290
292
  "Your portfolio and watchlists.": "Tu cartera y tus listas de seguimiento.",
@@ -837,7 +839,6 @@ export const es: Record<string, string> = {
837
839
  "Start group chat": "Iniciar chat grupal",
838
840
  "Use @username, or multiple usernames for a group chat": "Usa @username, o varios usuarios para un chat grupal",
839
841
  "Type DM @username to start one": "Escribe DM @username para empezar",
840
- "Read-only chat. Log in or sign up to send.": "Chat de solo lectura. Inicia sesión o regístrate para enviar.",
841
842
  "Saved login found. Log in again to send.": "Sesión guardada encontrada. Vuelve a iniciar sesión para enviar.",
842
843
  "Verify your email to send messages.": "Verifica tu correo para enviar mensajes.",
843
844
  // The first-chat prompt for an account still on its signup handle.
@@ -861,7 +862,6 @@ export const es: Record<string, string> = {
861
862
  "ask questions about anything on screen": "hacer preguntas sobre cualquier cosa en pantalla",
862
863
  "Free with a verified Gloom account.": "Gratis con una cuenta de Gloom verificada.",
863
864
  "search X": "buscar en X",
864
- "{shortcut}, then Resend Verification Email": "{shortcut} y luego Reenviar correo de verificación",
865
865
  "editing": "editando",
866
866
  "replying to": "respondiendo a",
867
867
  "Reply": "Responder",
@@ -1131,6 +1131,9 @@ export const es: Record<string, string> = {
1131
1131
  "No figures for {symbol}: its sponsor's site is not one Gloom reads, and the SEC's prospectus and N-PORT data sets list none for it yet.": "No hay cifras para {symbol}: Gloom no lee el sitio de su patrocinador y los conjuntos de datos de folletos y N-PORT de la SEC aún no incluyen ninguna.",
1132
1132
  "est. {range}": "est. {range}",
1133
1133
  "Shares outstanding": "Acciones en circulación",
1134
+ "Management fee": "Comisión de gestión",
1135
+ "Mgmt Fee": "Com. gestión",
1136
+ "Units per {asset}": "Unidades por {asset}",
1134
1137
  "1M flows": "Flujos 1M",
1135
1138
  "Structure": "Estructura",
1136
1139
  "Closed-end fund": "Fondo cerrado",
@@ -1267,7 +1270,7 @@ export const es: Record<string, string> = {
1267
1270
  "Rate limited — try again in a minute": "Límite alcanzado; inténtalo en un minuto",
1268
1271
  "{count}m": "{count} min",
1269
1272
  "{count}h": "{count} h",
1270
- "delayed data · upgrade": "datos diferidos · mejorar",
1273
+ "delayed": "de retraso",
1271
1274
  "upgrade": "mejorar",
1272
1275
  "real-time news": "noticias en tiempo real",
1273
1276
  "Pro trial · {days}d left": "Prueba Pro · quedan {days} d",
package/src/i18n/ja.ts CHANGED
@@ -286,6 +286,8 @@ export const ja: Record<string, string> = {
286
286
 
287
287
  // ── Context menu ─────────────────────────────────────────────
288
288
  "Start Here": "ここから始める",
289
+ "About": "このアプリについて",
290
+ "What's new in v{version}": "v{version} の新機能",
289
291
  "Research a company: the overview, then tabs for the chart, financials, news, filings and earnings calls.": "企業を調べる:概要から、チャート、財務、ニュース、提出書類、決算説明会のタブへ。",
290
292
  "Add what you own. Alerts and emails then follow your portfolio.": "保有銘柄を追加します。アラートとメールがポートフォリオに沿った内容になります。",
291
293
  "Your portfolio and watchlists.": "ポートフォリオとウォッチリスト。",
@@ -687,7 +689,7 @@ export const ja: Record<string, string> = {
687
689
  "{delay} delayed · try Pro live": "{delay}遅延 · Pro のリアルタイムを試す",
688
690
  "Pro trial {days}d": "Pro トライアル{days}日",
689
691
  "Pro trial — ends {date}": "Pro トライアル — {date} まで",
690
- "delayed data · upgrade": "データ遅延 · アップグレード",
692
+ "delayed": "遅延",
691
693
  "upgrade": "アップグレード",
692
694
  "real-time news": "リアルタイムニュース",
693
695
  "AI command bar": "AI コマンドバー",
@@ -852,7 +854,6 @@ export const ja: Record<string, string> = {
852
854
  "Start group chat": "グループチャットを開始する",
853
855
  "Use @username, or multiple usernames for a group chat": "グループ チャットには @username または複数のユーザー名を使用してください",
854
856
  "Type DM @username to start one": "DM @username と入力して開始します",
855
- "Read-only chat. Log in or sign up to send.": "読み取り専用チャット。送信するにはログインまたはサインアップしてください。",
856
857
  "Saved login found. Log in again to send.": "保存されたログインが見つかりました。送信するには再度ログインしてください。",
857
858
  "Verify your email to send messages.": "メッセージを送信するにはメールを確認してください。",
858
859
  // The first-chat prompt for an account still on its signup handle.
@@ -876,7 +877,6 @@ export const ja: Record<string, string> = {
876
877
  "ask questions about anything on screen": "画面上のあらゆる内容について質問",
877
878
  "Free with a verified Gloom account.": "認証済みの Gloom アカウントがあれば無料です。",
878
879
  "search X": "X を検索",
879
- "{shortcut}, then Resend Verification Email": "{shortcut} から「確認メールを再送信」",
880
880
  "editing": "編集",
881
881
  "replying to": "返信先",
882
882
  "Reply": "返信",
@@ -1146,6 +1146,9 @@ export const ja: Record<string, string> = {
1146
1146
  "No figures for {symbol}: its sponsor's site is not one Gloom reads, and the SEC's prospectus and N-PORT data sets list none for it yet.": "{symbol} の数値はありません。Gloom はスポンサーのサイトを読み込んでおらず、SEC の目論見書データセットと N-PORT データセットにもまだ掲載がありません。",
1147
1147
  "est. {range}": "推定 {range}",
1148
1148
  "Shares outstanding": "発行済口数",
1149
+ "Management fee": "運用報酬",
1150
+ "Mgmt Fee": "運用報酬",
1151
+ "Units per {asset}": "1 {asset}あたり口数",
1149
1152
  "1M flows": "1か月の資金流出入",
1150
1153
  "Structure": "形態",
1151
1154
  "Closed-end fund": "クローズドエンド型ファンド",