gloomberb 0.19.6 → 0.20.0
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.
- package/LICENSE +0 -4
- package/package.json +6 -5
- package/patches/electrobun-devkit@2.0.5.patch +148 -0
- package/src/api-client/bond-trades.ts +59 -0
- package/src/api-client/data.ts +21 -0
- package/src/api-client/index.ts +2 -0
- package/src/api-client/types/account.ts +86 -0
- package/src/api-client/types/assist.ts +32 -0
- package/src/api-client/types/auth.ts +63 -0
- package/src/api-client/types/billing.ts +54 -0
- package/src/api-client/types/chat.ts +180 -0
- package/src/api-client/types/congress.ts +107 -0
- package/src/api-client/types/credit.ts +110 -0
- package/src/api-client/types/econ.ts +158 -0
- package/src/api-client/types/equity-diagnostic.ts +73 -0
- package/src/api-client/types/filings-and-calls.ts +350 -0
- package/src/api-client/types/index.ts +25 -0
- package/src/api-client/types/jobs.ts +147 -0
- package/src/api-client/types/market.ts +122 -0
- package/src/api-client/types/news.ts +91 -0
- package/src/api-client/types/notes-and-theses.ts +172 -0
- package/src/api-client/types/quotes.ts +28 -0
- package/src/api-client/types/scanners.ts +125 -0
- package/src/api-client/types/screener.ts +65 -0
- package/src/api-client/types/search.ts +107 -0
- package/src/api-client/types/sync.ts +14 -0
- package/src/api-client/types/team-collections.ts +43 -0
- package/src/api-client/types/team-views.ts +32 -0
- package/src/api-client/types/teams.ts +135 -0
- package/src/api-client/types/ticker-data.ts +57 -0
- package/src/api-client/types/tweets.ts +59 -0
- package/src/api-client/types/world-venues.ts +23 -0
- package/src/app/runtime/desktop-deeplink.ts +41 -6
- package/src/app/star-prompt/status-line.tsx +1 -1
- package/src/app.tsx +1 -7
- package/src/architecture/ui-tokens-allowlist.json +0 -8
- package/src/cli/commands/ticker.ts +17 -4
- package/src/cli/desktop-pane-shot-browser.ts +69 -3
- package/src/cli/pane-functions/catalog.ts +3 -1
- package/src/components/chart/composite/use-composite-chart-keyboard.ts +11 -2
- package/src/components/data-table/export.ts +4 -1
- package/src/components/layout/detached-pane-shell.tsx +10 -37
- package/src/components/layout/double-escape-close.ts +90 -0
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +6 -3
- package/src/components/layout/pane/footer/index.tsx +2 -6
- package/src/components/layout/pane/footer/model.ts +6 -12
- package/src/components/layout/shell/active-drag.ts +53 -11
- package/src/components/layout/shell/drag/magnets.ts +128 -19
- package/src/components/layout/shell/pane/actions.ts +6 -2
- package/src/components/layout/shell/pane/management-shortcuts.ts +13 -51
- package/src/components/layout/status-bar.tsx +4 -78
- package/src/components/layout/status-widget-space.ts +5 -5
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +1 -1
- package/src/components/ui/data-table/index.tsx +5 -1
- package/src/components/ui/data-table/render-cell.ts +19 -0
- package/src/components/ui/delayed-mark.tsx +59 -7
- package/src/components/ui/icon.tsx +1 -8
- package/src/components/ui/menu.tsx +6 -1
- package/src/i18n/es.ts +3 -3
- package/src/i18n/ja.ts +3 -3
- package/src/i18n/ko.ts +3 -3
- package/src/i18n/zh-cn.ts +3 -3
- package/src/i18n/zh-tw.ts +3 -3
- package/src/plugins/builtin/chat/content/composer.tsx +21 -27
- package/src/plugins/builtin/chat/content/index.tsx +31 -3
- package/src/plugins/builtin/chat/content/shortcuts.ts +4 -2
- package/src/plugins/builtin/chat/content/snapshot.ts +0 -3
- package/src/plugins/builtin/cloud/auth-actions.tsx +51 -23
- package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +3 -3
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +32 -25
- package/src/plugins/builtin/congress-trades/model.ts +2 -1
- package/src/plugins/builtin/congress-trades/pane.tsx +3 -0
- package/src/plugins/builtin/custom-view/index.tsx +1 -1
- package/src/plugins/builtin/custom-view/loader.ts +85 -8
- package/src/plugins/builtin/custom-view/view-spec.ts +28 -0
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +13 -4
- package/src/plugins/builtin/equity-screener/headless.ts +33 -1
- package/src/plugins/builtin/equity-screener/model.ts +58 -15
- package/src/plugins/builtin/equity-screener/pane.tsx +36 -6
- package/src/plugins/builtin/executives/format.ts +5 -4
- package/src/plugins/builtin/executives/pane.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +55 -1
- package/src/plugins/builtin/insider/model.ts +30 -2
- package/src/plugins/builtin/jobs/model.ts +2 -2
- package/src/plugins/builtin/mna/model.ts +2 -2
- package/src/plugins/builtin/notes/files.ts +2 -0
- package/src/plugins/builtin/notes/owner.tsx +20 -1
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +22 -4
- package/src/plugins/builtin/notes/store.ts +6 -1
- package/src/plugins/builtin/portfolio-list/header.tsx +1 -1
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +29 -25
- package/src/plugins/builtin/series-inventory.ts +1 -0
- package/src/plugins/builtin/shared/earnings-report.ts +7 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +85 -46
- package/src/plugins/builtin/short-interest/headless.ts +1 -1
- package/src/plugins/builtin/short-interest/model.ts +15 -6
- package/src/plugins/builtin/short-interest/types.ts +2 -0
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +3 -0
- package/src/plugins/builtin/thirteenf/pane.tsx +3 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +5 -3
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +4 -4
- package/src/plugins/builtin/trace-bonds/detail.tsx +198 -0
- package/src/plugins/builtin/trace-bonds/headless.ts +62 -4
- package/src/plugins/builtin/trace-bonds/history.ts +155 -0
- package/src/plugins/builtin/trace-bonds/pane.tsx +64 -5
- package/src/plugins/installer.ts +16 -3
- package/src/plugins/plugin-names.ts +11 -2
- package/src/remote/controller.ts +9 -2
- package/src/remote/schema.ts +2 -1
- package/src/renderers/cloudflare/http-proxy.ts +67 -8
- package/src/renderers/cloudflare/proxy-session.ts +1 -1
- package/src/renderers/cloudflare/worker.ts +29 -2
- package/src/renderers/dom/desktop/icons.tsx +0 -2
- package/src/renderers/dom/styles.css +0 -3
- package/src/renderers/electrobun/bun/desktop/install-records.ts +59 -0
- package/src/renderers/electrobun/bun/desktop/installer-folder.ts +208 -592
- package/src/renderers/electrobun/bun/desktop/macos-objc.ts +14 -0
- package/src/renderers/electrobun/bun/desktop/update.ts +1 -1
- package/src/renderers/electrobun/bun/index.ts +19 -13
- package/src/renderers/electrobun/bun/window/create.ts +23 -3
- package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +4 -4
- package/src/renderers/electrobun/bun/window/events.ts +4 -4
- package/src/renderers/electrobun/bun/window/frame.ts +2 -1
- package/src/renderers/electrobun/bun/window/native-min-size.ts +322 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +1 -1
- package/src/sources/gloomberb-cloud/index.ts +5 -7
- package/src/sources/provider-router/batches.ts +18 -3
- package/src/sources/provider-router/financials.ts +18 -4
- package/src/types/data-provider.ts +14 -0
- package/src/types/financials.ts +15 -3
- package/src/types/headless.ts +2 -0
- package/src/utils/double-escape-close.ts +38 -16
- package/src/utils/format.ts +23 -3
- package/src/utils/price-earnings.ts +18 -0
- package/patches/electrobun@1.18.1.patch +0 -633
- package/src/api-client/types.ts +0 -2441
|
@@ -19,13 +19,7 @@ import { getPaneDisplayTitle } from "./pane/title";
|
|
|
19
19
|
import { TITLEBAR_OVERLAY_HEIGHT_PX, getTitlebarLeadingInset } from "./titlebar-overlay";
|
|
20
20
|
import { useWindowFullscreen } from "./window-fullscreen";
|
|
21
21
|
import { WindowControls, WINDOWS_CONTROL_GROUP_WIDTH_PX } from "./window-controls";
|
|
22
|
-
import {
|
|
23
|
-
armDoubleEscapeClose,
|
|
24
|
-
createDoubleEscapeCloseState,
|
|
25
|
-
offerEscapeTowardClose,
|
|
26
|
-
resetDoubleEscapeClose,
|
|
27
|
-
takeDoubleEscapeClose,
|
|
28
|
-
} from "../../utils/double-escape-close";
|
|
22
|
+
import { useDoubleEscapeClose } from "./double-escape-close";
|
|
29
23
|
import { contextMenuDivider, type ContextMenuItem } from "../../types/context-menu";
|
|
30
24
|
import { useKeybindings } from "../../app/keybindings";
|
|
31
25
|
import { useDialogState } from "../../ui/dialog";
|
|
@@ -61,7 +55,6 @@ export function DetachedPaneShell({ pluginRegistry, desktopWindowBridge }: Detac
|
|
|
61
55
|
const config = usePaneAppConfig();
|
|
62
56
|
const paneState = useAppSelector((state) => state.paneState);
|
|
63
57
|
const inputCaptured = useAppSelector((state) => state.inputCaptured);
|
|
64
|
-
const doubleEscapeCloseRef = useRef(createDoubleEscapeCloseState());
|
|
65
58
|
// A key held down, or a trigger with no repeat flag, runs each action once.
|
|
66
59
|
const [shots] = useState(createOneShots);
|
|
67
60
|
const keybindings = useKeybindings();
|
|
@@ -132,35 +125,15 @@ export function DetachedPaneShell({ pluginRegistry, desktopWindowBridge }: Detac
|
|
|
132
125
|
};
|
|
133
126
|
}, [focusPane]);
|
|
134
127
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
resetDoubleEscapeClose(doubleEscapeState);
|
|
148
|
-
}, { phase: "before" });
|
|
149
|
-
|
|
150
|
-
const armDoubleEscape = () => {
|
|
151
|
-
armDoubleEscapeClose(doubleEscapeCloseRef.current, desktopWindowBridge.paneId, Date.now());
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
// A pane that uses an Esc to leave an empty field may still count it.
|
|
155
|
-
useShortcut((event) => {
|
|
156
|
-
if (event.name !== "escape" && event.name !== "esc") return;
|
|
157
|
-
offerEscapeTowardClose(event, armDoubleEscape);
|
|
158
|
-
}, { phase: "before", allowEditable: true });
|
|
159
|
-
|
|
160
|
-
useShortcut((event) => {
|
|
161
|
-
if (event.name !== "escape" && event.name !== "esc") return;
|
|
162
|
-
armDoubleEscape();
|
|
163
|
-
}, { phase: "idle" });
|
|
128
|
+
useDoubleEscapeClose({
|
|
129
|
+
targetId: desktopWindowBridge.paneId,
|
|
130
|
+
overlayOpen: dialogOpen || menuState !== null,
|
|
131
|
+
editing: inputCaptured,
|
|
132
|
+
close: () => {
|
|
133
|
+
if (!locked) fireAndForget(desktopWindowBridge.closeDetachedPane?.(desktopWindowBridge.paneId), "desktop.closeDetachedPane");
|
|
134
|
+
return true;
|
|
135
|
+
},
|
|
136
|
+
});
|
|
164
137
|
|
|
165
138
|
const closePane = useCallback(() => {
|
|
166
139
|
if (locked) {
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { useBeforeShortcut, useShortcut, type KeyEventLike } from "../../react/input";
|
|
3
|
+
import {
|
|
4
|
+
armDoubleEscapeClose,
|
|
5
|
+
createDoubleEscapeCloseState,
|
|
6
|
+
isEscapeKeptFromClosing,
|
|
7
|
+
offerEscapeTowardClose,
|
|
8
|
+
resetDoubleEscapeClose,
|
|
9
|
+
takeDoubleEscapeClose,
|
|
10
|
+
} from "../../utils/double-escape-close";
|
|
11
|
+
|
|
12
|
+
function isEscapeKey(event: KeyEventLike): boolean {
|
|
13
|
+
return event.name === "escape" || event.name === "esc";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface DoubleEscapeCloseOptions {
|
|
17
|
+
/** The pane a pair of Esc presses closes. */
|
|
18
|
+
targetId: string | null;
|
|
19
|
+
/** A menu, dialog or other overlay is open: its Esc is its own. */
|
|
20
|
+
overlayOpen: boolean;
|
|
21
|
+
/** The pane is editing (input capture): its Esc counts only when the pane counts it. */
|
|
22
|
+
editing: boolean;
|
|
23
|
+
/** A drag is under way: Esc cancels it. */
|
|
24
|
+
dragging?: () => boolean;
|
|
25
|
+
/** Closes the target; false when nothing was closed and the Esc goes on to the pane. */
|
|
26
|
+
close(): boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Esc Esc closes the focused pane, even one that could still go back: every
|
|
31
|
+
* Esc is the first half of a pair, whatever the pane did with it. Kept out:
|
|
32
|
+
*
|
|
33
|
+
* - an Esc in a text field, or while the pane is editing, unless the pane
|
|
34
|
+
* counts it because nothing typed is left behind (an empty composer);
|
|
35
|
+
* - an Esc while a menu, dialog or overlay is open, and one that closes a
|
|
36
|
+
* menu or popover of the pane's own (`keepEscapeFromClosing`);
|
|
37
|
+
* - a held Esc, which closes one pane: the shortcut registry drops its
|
|
38
|
+
* repeats, and a stream without the flag cools down in `arm`.
|
|
39
|
+
*
|
|
40
|
+
* A surface that takes Esc in a scoped `before` handler (onboarding, a form,
|
|
41
|
+
* key capture) runs ahead of the arming and so never counts.
|
|
42
|
+
*/
|
|
43
|
+
export function useDoubleEscapeClose({ targetId, overlayOpen, editing, dragging, close }: DoubleEscapeCloseOptions): void {
|
|
44
|
+
const stateRef = useRef(createDoubleEscapeCloseState());
|
|
45
|
+
const live = useRef({ targetId, overlayOpen });
|
|
46
|
+
live.current = { targetId, overlayOpen };
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (overlayOpen) resetDoubleEscapeClose(stateRef.current);
|
|
50
|
+
}, [overlayOpen]);
|
|
51
|
+
|
|
52
|
+
// Before any handler, so one in any phase or scope can count or keep its Esc.
|
|
53
|
+
useBeforeShortcut((event) => {
|
|
54
|
+
const state = stateRef.current;
|
|
55
|
+
if (!isEscapeKey(event)) {
|
|
56
|
+
resetDoubleEscapeClose(state);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const at = Date.now();
|
|
60
|
+
offerEscapeTowardClose(event, {
|
|
61
|
+
count: () => {
|
|
62
|
+
if (!live.current.overlayOpen) armDoubleEscapeClose(state, live.current.targetId, at);
|
|
63
|
+
},
|
|
64
|
+
keep: () => resetDoubleEscapeClose(state),
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// The second Esc of a pair closes before anything else sees it, so a pane
|
|
69
|
+
// with more to go back through still closes. Not in a text field.
|
|
70
|
+
useShortcut((event) => {
|
|
71
|
+
if (!isEscapeKey(event) || overlayOpen || editing || dragging?.()) return;
|
|
72
|
+
if (takeDoubleEscapeClose(stateRef.current, targetId, Date.now()) && close()) {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
event.stopPropagation();
|
|
75
|
+
}
|
|
76
|
+
}, { phase: "capture" });
|
|
77
|
+
|
|
78
|
+
// The first: after the scoped surfaces that own their Esc (onboarding, a
|
|
79
|
+
// form, key capture), so theirs never counts, and before the pane.
|
|
80
|
+
useShortcut((event) => {
|
|
81
|
+
if (!isEscapeKey(event)) return;
|
|
82
|
+
const state = stateRef.current;
|
|
83
|
+
if (overlayOpen || dragging?.()) {
|
|
84
|
+
resetDoubleEscapeClose(state);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (editing || isEscapeKeptFromClosing(event)) return;
|
|
88
|
+
armDoubleEscapeClose(state, targetId, Date.now());
|
|
89
|
+
}, { phase: "before" });
|
|
90
|
+
}
|
|
@@ -769,8 +769,9 @@ function HeaderMarketSummary({ nativePaneChrome, width }: { nativePaneChrome: bo
|
|
|
769
769
|
available: width,
|
|
770
770
|
baseCurrencyWidth: displayWidth(summary.baseCurrencyLabel) + 1,
|
|
771
771
|
countdownWidth: summary.marketLabel.length - summary.marketLabelShort.length,
|
|
772
|
-
// A delayed SPY
|
|
773
|
-
//
|
|
772
|
+
// A delayed SPY carries its mark only while the status bar does not say the
|
|
773
|
+
// delay. Then the two fit, or give way, together, and once the rest of the
|
|
774
|
+
// cluster is gone SPY gives up its move rather than give way.
|
|
774
775
|
spyWidth: summary.spyText.length + 1 + (summary.spyDelayMinutes != null ? delayedMarkWidth(summary.spyDelayMinutes, nativePaneChrome) + 1 : 0),
|
|
775
776
|
spyMoveWidth: summary.spyDelayMinutes != null ? summary.spyText.length - summary.spyPriceText.length : 0,
|
|
776
777
|
stateWidth: summary.marketLabelShort ? summary.marketLabelShort.length + 1 : 0,
|
|
@@ -12,7 +12,7 @@ import { formatPercentRaw } from "../../utils/format";
|
|
|
12
12
|
import { formatMarketPriceWithCurrency, liveQuoteFormatOptions } from "../../market-data/market/format";
|
|
13
13
|
import { getSessionMoveDisplay, marketStateColor, marketStateCountdown, marketStateLabel } from "../../market-data/market/status";
|
|
14
14
|
import type { Quote } from "../../types/financials";
|
|
15
|
-
import {
|
|
15
|
+
import { useDelayedMarkMinutes } from "../ui/delayed-mark";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* SPY rides the shared feed. The snapshot poll only runs while the feed has
|
|
@@ -45,7 +45,10 @@ export interface MarketSummary {
|
|
|
45
45
|
spyText: string;
|
|
46
46
|
/** `spyText` without its move (`SPY $762.43`), for a delayed SPY in a header too narrow for both and the mark. */
|
|
47
47
|
spyPriceText: string;
|
|
48
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Minutes SPY's price is late for this account (signed out or free), drawn as the delayed
|
|
50
|
+
* mark beside it; null when live, and while the status bar's delayed note says it for the app.
|
|
51
|
+
*/
|
|
49
52
|
spyDelayMinutes: number | null;
|
|
50
53
|
}
|
|
51
54
|
|
|
@@ -151,7 +154,7 @@ export function useMarketSummary(): MarketSummary {
|
|
|
151
154
|
}, [appActive]);
|
|
152
155
|
|
|
153
156
|
const { spyColor, spyPriceText, spyText } = spySummary(spyQuote, colors);
|
|
154
|
-
const spyDelayMinutes =
|
|
157
|
+
const spyDelayMinutes = useDelayedMarkMinutes(spyQuote);
|
|
155
158
|
|
|
156
159
|
const mktCountdown = mktState ? marketStateCountdown(mktState, now) : null;
|
|
157
160
|
const marketLabelShort = mktState ? t(marketStateLabel(mktState)) : "";
|
|
@@ -81,12 +81,10 @@ function terminalSegmentKey(segment: PaneFooterSegment, focused: boolean): strin
|
|
|
81
81
|
: "";
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/** Columns an icon segment keeps when hints crowd the footer
|
|
84
|
+
/** Columns an icon segment keeps when hints crowd the footer. */
|
|
85
85
|
function iconSegmentReserve(segment: PaneFooterSegment, focused: boolean, nativePaneChrome: boolean): number {
|
|
86
86
|
if (!segment.icon) return 0;
|
|
87
|
-
return nativePaneChrome
|
|
88
|
-
? 3 + (segment.iconText ? segment.iconText.length + 1 : 0)
|
|
89
|
-
: Math.max(3, 1 + terminalSegmentKey(segment, focused).length);
|
|
87
|
+
return nativePaneChrome ? 3 : Math.max(3, 1 + terminalSegmentKey(segment, focused).length);
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
function SegmentView({ segment, focused }: { segment: PaneFooterSegment; focused: boolean }) {
|
|
@@ -127,7 +125,6 @@ function SegmentView({ segment, focused }: { segment: PaneFooterSegment; focused
|
|
|
127
125
|
data-icon={segment.icon}
|
|
128
126
|
>
|
|
129
127
|
<Icon name={segment.icon} size={14} color={segment.disabled ? colors.textMuted : footerToneColor(segment.parts[0] ?? { text: "" })} />
|
|
130
|
-
{segment.iconText ? <Text fg={colors.textMuted} selectable={false} data-gloom-role="pane-footer-icon-text">{segment.iconText}</Text> : null}
|
|
131
128
|
</Box>
|
|
132
129
|
);
|
|
133
130
|
}
|
|
@@ -144,7 +141,6 @@ function SegmentView({ segment, focused }: { segment: PaneFooterSegment; focused
|
|
|
144
141
|
disabled={!interactive}
|
|
145
142
|
color={segment.disabled ? colors.textMuted : footerToneColor(segment.parts[0] ?? { text: "" })}
|
|
146
143
|
onPress={() => segment.onPress?.()}
|
|
147
|
-
text={segment.iconText}
|
|
148
144
|
/>
|
|
149
145
|
);
|
|
150
146
|
}
|
|
@@ -30,12 +30,6 @@ export interface PaneFooterSegment {
|
|
|
30
30
|
* data a source delivers late: build it with {@link delayedFooterSegment}.
|
|
31
31
|
*/
|
|
32
32
|
icon?: "warning" | "clock";
|
|
33
|
-
/**
|
|
34
|
-
* A few characters the desktop draws after `icon`, in the footer's muted
|
|
35
|
-
* tone, so the segment reads without hovering: a delay's `15m`. The
|
|
36
|
-
* terminal's `parts` already carry it (`◷15m`).
|
|
37
|
-
*/
|
|
38
|
-
iconText?: string;
|
|
39
33
|
/**
|
|
40
34
|
* The segment only dates the pane's data (`as of 2026-10-05`). A `gloomberb
|
|
41
35
|
* shot` whose status line already dates that data leaves it out, so the
|
|
@@ -89,11 +83,12 @@ export interface PaneFooterSegment {
|
|
|
89
83
|
const DELAYED_FOOTER_GLYPH = "◷";
|
|
90
84
|
|
|
91
85
|
/**
|
|
92
|
-
* The footer's one form for data a source delivers late: a yellow clock
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
86
|
+
* The footer's one form for data a source delivers late: a yellow clock with
|
|
87
|
+
* `detail` in its tooltip on the desktop and the web, and the clock with the
|
|
88
|
+
* delay (`◷15m`) in the terminal, which has no tooltip, so it takes a few
|
|
89
|
+
* cells rather than a phrase. The clock alone keeps the delay from repeating
|
|
90
|
+
* in every pane: the status bar's delayed note spells out the account's
|
|
91
|
+
* (`◷ 15m delayed`). `onPress` makes it a button, such as an upgrade.
|
|
97
92
|
*/
|
|
98
93
|
export function delayedFooterSegment({
|
|
99
94
|
id,
|
|
@@ -116,7 +111,6 @@ export function delayedFooterSegment({
|
|
|
116
111
|
label: detail,
|
|
117
112
|
title: detail,
|
|
118
113
|
parts: [{ text: `${DELAYED_FOOTER_GLYPH}${delay ?? ""}`, tone: "warning" }],
|
|
119
|
-
...(delay ? { iconText: delay } : {}),
|
|
120
114
|
...(onPress ? { onPress } : {}),
|
|
121
115
|
...(quoteStatus ? { quoteStatus } : {}),
|
|
122
116
|
};
|
|
@@ -32,11 +32,14 @@ import {
|
|
|
32
32
|
import type { ShellDragRuntimeState, ShellMouseEvent } from "./drag/runtime";
|
|
33
33
|
import type { WindowEditState } from "../window-edit/mode";
|
|
34
34
|
import {
|
|
35
|
+
createMagnetGlide,
|
|
35
36
|
createMagnetPace,
|
|
37
|
+
NO_GLIDE,
|
|
36
38
|
NO_LATCH,
|
|
37
39
|
snapMovedRect,
|
|
38
40
|
snapResizedRect,
|
|
39
41
|
type MagnetDistances,
|
|
42
|
+
type MagnetGlide,
|
|
40
43
|
type MagnetLatch,
|
|
41
44
|
type MagnetPace,
|
|
42
45
|
} from "./drag/magnets";
|
|
@@ -111,7 +114,9 @@ export function useShellActiveDrag({
|
|
|
111
114
|
// the edges its magnets hold, with the other panes' rects they hold to, the
|
|
112
115
|
// join it is holding still for, and on the desktop where the pointer has
|
|
113
116
|
// been lately (the magnets wait for it to slow down) with the check that
|
|
114
|
-
// catches once it rests
|
|
117
|
+
// catches once it rests, and where the pane is drawn against where the
|
|
118
|
+
// pointer puts it, with the frame that moves it there while the pointer is
|
|
119
|
+
// still.
|
|
115
120
|
const memoRef = useRef<{
|
|
116
121
|
drag: unknown;
|
|
117
122
|
baseRect: FloatingRect | null;
|
|
@@ -121,10 +126,15 @@ export function useShellActiveDrag({
|
|
|
121
126
|
magnetTargets: LayoutBounds[] | null;
|
|
122
127
|
join: PendingJoin | null;
|
|
123
128
|
pace: MagnetPace;
|
|
124
|
-
|
|
129
|
+
glide: MagnetGlide;
|
|
130
|
+
}>({
|
|
131
|
+
drag: null, baseRect: null, dropKey: null, drop: null, latch: NO_LATCH, magnetTargets: null, join: null,
|
|
132
|
+
pace: createMagnetPace(), glide: createMagnetGlide(),
|
|
133
|
+
});
|
|
125
134
|
useEffect(() => () => {
|
|
126
135
|
dropPendingJoin(memoRef.current);
|
|
127
136
|
memoRef.current.pace.reset();
|
|
137
|
+
memoRef.current.glide.reset();
|
|
128
138
|
}, []);
|
|
129
139
|
// The handler as it is now, for the rest check to run again.
|
|
130
140
|
const handleRef = useRef<(event: ShellMouseEvent) => void>(() => {});
|
|
@@ -152,6 +162,7 @@ export function useShellActiveDrag({
|
|
|
152
162
|
memo.latch = NO_LATCH;
|
|
153
163
|
memo.magnetTargets = null;
|
|
154
164
|
memo.pace.reset();
|
|
165
|
+
memo.glide.reset();
|
|
155
166
|
dropPendingJoin(memo);
|
|
156
167
|
}
|
|
157
168
|
// Any later event supersedes the rest check of an earlier move.
|
|
@@ -169,9 +180,9 @@ export function useShellActiveDrag({
|
|
|
169
180
|
};
|
|
170
181
|
const magnetsOff = event.modifiers?.alt === true;
|
|
171
182
|
const magnetArea = { x: 0, y: 0, width, height: contentHeight };
|
|
172
|
-
// Desktop:
|
|
173
|
-
//
|
|
174
|
-
//
|
|
183
|
+
// Desktop: past the travel speed a release lands the pane where the
|
|
184
|
+
// pointer puts it, its magnets left out (the rest check runs the last move
|
|
185
|
+
// again once the pointer has stopped, so a release then catches). What
|
|
175
186
|
// they hold to still follows every move, so it rests where it would have.
|
|
176
187
|
const travelling = () => {
|
|
177
188
|
if (!nativePaneChrome || drag.type !== "pane-drag") return false;
|
|
@@ -179,14 +190,40 @@ export function useShellActiveDrag({
|
|
|
179
190
|
const rest = event.type === "drag" ? () => { if (dragRef.current === drag) handleRef.current(event); } : undefined;
|
|
180
191
|
return memo.pace.travelling({ t: performance.now(), x: preciseX, y: preciseShellY }, magnetDistances, rest);
|
|
181
192
|
};
|
|
182
|
-
|
|
193
|
+
// Where a move lands the pane (`rect`), and where its magnets hold it as
|
|
194
|
+
// the pointer slows down (`snapped`).
|
|
195
|
+
const snapMove = (paneId: string, rect: FloatingRect): { rect: FloatingRect; snapped: FloatingRect } => {
|
|
183
196
|
if (magnetsOff) {
|
|
184
197
|
memo.latch = NO_LATCH;
|
|
185
|
-
return rect;
|
|
198
|
+
return { rect, snapped: rect };
|
|
186
199
|
}
|
|
187
200
|
const snapped = snapMovedRect(rect, magnetTargets(paneId), magnetArea, magnetDistances, memo.latch);
|
|
188
201
|
memo.latch = snapped.latch;
|
|
189
|
-
return travelling() ? rect : snapped.rect;
|
|
202
|
+
return { rect: travelling() ? rect : snapped.rect, snapped: snapped.rect };
|
|
203
|
+
};
|
|
204
|
+
// Desktop: the moving pane is drawn under the pointer while it moves, and
|
|
205
|
+
// where its magnets hold it once the pointer slows down to place it,
|
|
206
|
+
// gliding between the two (the frames after the pointer stops carry the
|
|
207
|
+
// glide on). The terminal draws where a release would land it.
|
|
208
|
+
const drawMove = (paneId: string, free: FloatingRect, moved: { rect: FloatingRect; snapped: FloatingRect }) => {
|
|
209
|
+
if (!nativePaneChrome) {
|
|
210
|
+
updateDragFloatingRect({ paneId, rect: moved.rect });
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const { snapped } = moved;
|
|
214
|
+
let drawn: { x: number; y: number } | null = null;
|
|
215
|
+
memo.glide.follow(() => {
|
|
216
|
+
const now = performance.now();
|
|
217
|
+
const placing = memo.pace.placing(now, magnetDistances);
|
|
218
|
+
const target = placing ? { x: snapped.x - free.x, y: snapped.y - free.y } : NO_GLIDE;
|
|
219
|
+
const offset = memo.glide.step(now, target);
|
|
220
|
+
// A frame that moves nothing (the pointer still, the glide at rest) restyles nothing.
|
|
221
|
+
if (!drawn || drawn.x !== offset.x || drawn.y !== offset.y) {
|
|
222
|
+
drawn = offset;
|
|
223
|
+
updateDragFloatingRect({ paneId, rect: { ...free, x: free.x + offset.x, y: free.y + offset.y } });
|
|
224
|
+
}
|
|
225
|
+
return placing && memo.glide.settled(target);
|
|
226
|
+
});
|
|
190
227
|
};
|
|
191
228
|
const snapResize = (paneId: string, rect: FloatingRect, edges: { x: -1 | 0 | 1; y: -1 | 0 | 1 }): FloatingRect => {
|
|
192
229
|
if (magnetsOff) {
|
|
@@ -221,6 +258,7 @@ export function useShellActiveDrag({
|
|
|
221
258
|
if (event.type === "drag-cancel") {
|
|
222
259
|
// The window lost focus or the system took the pointer: put everything back.
|
|
223
260
|
dropPendingJoin(memo);
|
|
261
|
+
memo.glide.reset();
|
|
224
262
|
cancelActiveDrag();
|
|
225
263
|
event.stopPropagation();
|
|
226
264
|
event.preventDefault();
|
|
@@ -248,6 +286,7 @@ export function useShellActiveDrag({
|
|
|
248
286
|
}
|
|
249
287
|
} else if (drag.type === "pane-drag") {
|
|
250
288
|
if (!isMeaningfulPaneDrag(drag.startX, drag.startY, preciseX, preciseShellY, dragThreshold)) {
|
|
289
|
+
memo.glide.reset();
|
|
251
290
|
updateDockPreview(null);
|
|
252
291
|
if (drag.mode === "floating") {
|
|
253
292
|
updateDragFloatingRect({ paneId: drag.paneId, rect: drag.origRect });
|
|
@@ -257,8 +296,10 @@ export function useShellActiveDrag({
|
|
|
257
296
|
return;
|
|
258
297
|
}
|
|
259
298
|
|
|
260
|
-
const
|
|
261
|
-
|
|
299
|
+
const freeRect = resolvePaneDragFloatingRect(drag, dragBaseRect()!, drawX, drawShellY, width, contentHeight);
|
|
300
|
+
const moved = snapMove(drag.paneId, freeRect);
|
|
301
|
+
const nextRect = moved.rect;
|
|
302
|
+
drawMove(drag.paneId, freeRect, moved);
|
|
262
303
|
|
|
263
304
|
// Over a title bar it would be a tab there; pushed against a docked
|
|
264
305
|
// pane's edge it would join the dock on that side.
|
|
@@ -325,6 +366,7 @@ export function useShellActiveDrag({
|
|
|
325
366
|
|
|
326
367
|
if (event.type === "up" || event.type === "drag-end") {
|
|
327
368
|
dropPendingJoin(memo);
|
|
369
|
+
memo.glide.reset();
|
|
328
370
|
if (drag.type === "divider") {
|
|
329
371
|
if (live.get().divider) {
|
|
330
372
|
const nextLayout = resizeSplitAtPath(baseLayout, drag.path, dividerRatioAt(preciseX, preciseShellY));
|
|
@@ -343,7 +385,7 @@ export function useShellActiveDrag({
|
|
|
343
385
|
// A click on a stack's tab shows that pane.
|
|
344
386
|
if (drag.mode === "docked") focusPane(drag.paneId);
|
|
345
387
|
} else {
|
|
346
|
-
const releaseRect = snapMove(drag.paneId, resolvePaneDragFloatingRect(drag, dragBaseRect()!, preciseX, preciseShellY, width, contentHeight));
|
|
388
|
+
const releaseRect = snapMove(drag.paneId, resolvePaneDragFloatingRect(drag, dragBaseRect()!, preciseX, preciseShellY, width, contentHeight)).rect;
|
|
347
389
|
const nextLayout = finalizePaneDragRelease(baseLayout, drag.paneId, releaseRect, live.get().dockPreview);
|
|
348
390
|
if (windowMode) {
|
|
349
391
|
updateWindowModePreviewLayout(nextLayout, drag.paneId);
|
|
@@ -37,13 +37,24 @@ const MAGNET_RELEASE_PX = 12;
|
|
|
37
37
|
const TERMINAL_MAGNETS: MagnetDistances = { catchX: 1, catchY: 1, releaseX: 2, releaseY: 2 };
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Desktop:
|
|
41
|
-
*
|
|
42
|
-
* pane follows the pointer exactly. Holding an edge on every line a window
|
|
43
|
-
* crossed on its way stopped it for 20 px at each one and then jumped it,
|
|
44
|
-
* which read as a drag that lags and stutters.
|
|
40
|
+
* Desktop: past this pointer speed, in catch distances a second (300 px/s),
|
|
41
|
+
* a release lands the pane where the pointer puts it, its magnets left out.
|
|
45
42
|
*/
|
|
46
43
|
const MAGNET_TRAVEL_SPEED = 300 / MAGNET_CATCH_PX;
|
|
44
|
+
/**
|
|
45
|
+
* Desktop: below this pointer speed (60 px/s, about a px a frame) the pointer
|
|
46
|
+
* is placing the pane, and it is drawn where its magnets hold it; faster, it
|
|
47
|
+
* is drawn under the pointer. Drawing the magnets at a hand's usual speed
|
|
48
|
+
* held the pane on each line it crossed, then jumped it up to 18 px, which
|
|
49
|
+
* read as a drag that lags and stutters.
|
|
50
|
+
*/
|
|
51
|
+
const MAGNET_PLACE_SPEED = 60 / MAGNET_CATCH_PX;
|
|
52
|
+
/**
|
|
53
|
+
* How fast the drawn pane glides between the pointer's place and the
|
|
54
|
+
* magnets', 1/s: a critically damped spring that settles in about 0.17 s and
|
|
55
|
+
* moves it at most about a fifth of the distance in a 60 Hz frame.
|
|
56
|
+
*/
|
|
57
|
+
const GLIDE_RATE = 35;
|
|
47
58
|
/** How far back the pointer's speed is read, ms: a few frames. */
|
|
48
59
|
const SPEED_WINDOW_MS = 64;
|
|
49
60
|
/** How long the pointer rests before the magnets catch where it stopped, ms. */
|
|
@@ -66,9 +77,10 @@ function trackPointer(track: PointerSample[], sample: PointerSample): void {
|
|
|
66
77
|
/**
|
|
67
78
|
* Desktop: when a moving pane's magnets act, over one drag. `travelling`
|
|
68
79
|
* takes each move and says whether the pointer is on its way somewhere; while
|
|
69
|
-
* it is, the pane
|
|
70
|
-
* to run once the pointer has stopped for
|
|
71
|
-
* catch where it stopped.
|
|
80
|
+
* it is, a release lands the pane where the pointer puts it, and `rest` (the
|
|
81
|
+
* move run again) is set to run once the pointer has stopped for
|
|
82
|
+
* MAGNET_REST_MS, so the magnets catch where it stopped. `placing` says
|
|
83
|
+
* whether the magnets are drawn. Any later move drops that check, travelling or not:
|
|
72
84
|
* run after a slower move, it would put the pane back where the pointer was.
|
|
73
85
|
* The check runs at the start of a frame, after the moves that frame brings,
|
|
74
86
|
* so a page drawing fewer frames than 1 / MAGNET_REST_MS still sees a
|
|
@@ -76,6 +88,8 @@ function trackPointer(track: PointerSample[], sample: PointerSample): void {
|
|
|
76
88
|
*/
|
|
77
89
|
export interface MagnetPace {
|
|
78
90
|
travelling(sample: PointerSample, distances: MagnetDistances, rest?: () => void): boolean;
|
|
91
|
+
/** Whether the pointer, as of `now`, moves slowly enough to be placing the pane: its magnets are drawn. */
|
|
92
|
+
placing(now: number, distances: MagnetDistances): boolean;
|
|
79
93
|
/** Drops the rest check: another event of the drag came first. */
|
|
80
94
|
cancel(): void;
|
|
81
95
|
/** Forgets the pointer's path, for a new drag. */
|
|
@@ -98,7 +112,7 @@ export function createMagnetPace(): MagnetPace {
|
|
|
98
112
|
const last = track[track.length - 1];
|
|
99
113
|
// The same place again (a rest check, a repeated event) is not a move.
|
|
100
114
|
if (!last || last.x !== sample.x || last.y !== sample.y) trackPointer(track, sample);
|
|
101
|
-
if (
|
|
115
|
+
if (pointerSpeed(track, sample.t, distances) <= MAGNET_TRAVEL_SPEED) return false;
|
|
102
116
|
if (onRest) {
|
|
103
117
|
rest = setTimeout(() => {
|
|
104
118
|
rest = null;
|
|
@@ -111,6 +125,7 @@ export function createMagnetPace(): MagnetPace {
|
|
|
111
125
|
}
|
|
112
126
|
return true;
|
|
113
127
|
},
|
|
128
|
+
placing: (now, distances) => pointerSpeed(track, now, distances) < MAGNET_PLACE_SPEED,
|
|
114
129
|
cancel,
|
|
115
130
|
reset() {
|
|
116
131
|
cancel();
|
|
@@ -120,15 +135,14 @@ export function createMagnetPace(): MagnetPace {
|
|
|
120
135
|
}
|
|
121
136
|
|
|
122
137
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* sits on.
|
|
138
|
+
* How fast the pointer moves as of `now`: how far it went over the last few
|
|
139
|
+
* frames, in catch distances a second; still since then, none. A move with
|
|
140
|
+
* nothing before it (the first of a drag) is as fast as can be, so a pane
|
|
141
|
+
* leaves its spot without catching the lines it sits on.
|
|
128
142
|
*/
|
|
129
|
-
function
|
|
143
|
+
function pointerSpeed(track: readonly PointerSample[], now: number, distances: MagnetDistances): number {
|
|
130
144
|
const latest = track[track.length - 1];
|
|
131
|
-
if (!latest) return
|
|
145
|
+
if (!latest) return 0;
|
|
132
146
|
const since = now - SPEED_WINDOW_MS;
|
|
133
147
|
let from = track[0]!;
|
|
134
148
|
for (const sample of track) {
|
|
@@ -136,10 +150,105 @@ function pointerTravelling(track: readonly PointerSample[], now: number, distanc
|
|
|
136
150
|
from = sample;
|
|
137
151
|
}
|
|
138
152
|
const span = Math.min(SPEED_WINDOW_MS, now - from.t);
|
|
139
|
-
if (from === latest) return track.length === 1 && span <= 0;
|
|
140
|
-
if (span <= 0) return
|
|
153
|
+
if (from === latest) return track.length === 1 && span <= 0 ? Infinity : 0;
|
|
154
|
+
if (span <= 0) return Infinity;
|
|
141
155
|
const catches = Math.hypot((latest.x - from.x) / distances.catchX, (latest.y - from.y) / distances.catchY);
|
|
142
|
-
return (catches / span) * 1000
|
|
156
|
+
return (catches / span) * 1000;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** An offset of a moving pane's drawn place from where the pointer puts it, in cells. */
|
|
160
|
+
export interface GlideOffset {
|
|
161
|
+
x: number;
|
|
162
|
+
y: number;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const NO_GLIDE: GlideOffset = { x: 0, y: 0 };
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Desktop: where a moving pane is drawn, as an offset from where the pointer
|
|
169
|
+
* puts it, gliding toward `target` (where its magnets hold it, or nothing):
|
|
170
|
+
* a catch or a release moves it over a few frames instead of in one, and it
|
|
171
|
+
* comes to rest exactly on `target`, so it rests and lands where it would
|
|
172
|
+
* have without the glide.
|
|
173
|
+
*/
|
|
174
|
+
export interface MagnetGlide {
|
|
175
|
+
step(now: number, target: GlideOffset): GlideOffset;
|
|
176
|
+
/** Whether it rests on `target`. */
|
|
177
|
+
settled(target: GlideOffset): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Draws the pane now with `draw`, and on each frame after until `draw`
|
|
180
|
+
* says it rests: the frames that carry a glide on once the pointer stops.
|
|
181
|
+
* A later `draw` takes over from an earlier one.
|
|
182
|
+
*/
|
|
183
|
+
follow(draw: () => boolean): void;
|
|
184
|
+
/** Back under the pointer, with no frame to come: a drag ended or began. */
|
|
185
|
+
reset(): void;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function requestFrame(callback: () => void): ReturnType<typeof setTimeout> | number {
|
|
189
|
+
return typeof requestAnimationFrame === "function" ? requestAnimationFrame(callback) : setTimeout(callback, 16);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function cancelFrame(frame: ReturnType<typeof setTimeout> | number): void {
|
|
193
|
+
if (typeof cancelAnimationFrame === "function" && typeof frame === "number") cancelAnimationFrame(frame);
|
|
194
|
+
else clearTimeout(frame as ReturnType<typeof setTimeout>);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function createMagnetGlide(): MagnetGlide {
|
|
198
|
+
let x = 0;
|
|
199
|
+
let y = 0;
|
|
200
|
+
let vx = 0;
|
|
201
|
+
let vy = 0;
|
|
202
|
+
let last: number | null = null;
|
|
203
|
+
let frame: ReturnType<typeof setTimeout> | number | null = null;
|
|
204
|
+
let drawing: (() => boolean) | null = null;
|
|
205
|
+
const stop = () => {
|
|
206
|
+
if (frame !== null) cancelFrame(frame);
|
|
207
|
+
frame = null;
|
|
208
|
+
drawing = null;
|
|
209
|
+
};
|
|
210
|
+
const tick = () => {
|
|
211
|
+
frame = null;
|
|
212
|
+
if (drawing && !drawing()) frame = requestFrame(tick);
|
|
213
|
+
};
|
|
214
|
+
// One axis of a critically damped spring after `dt` seconds: [place, speed].
|
|
215
|
+
const spring = (place: number, speed: number, target: number, dt: number): [number, number] => {
|
|
216
|
+
const off = place - target;
|
|
217
|
+
const decay = Math.exp(-GLIDE_RATE * dt);
|
|
218
|
+
const pull = speed + GLIDE_RATE * off;
|
|
219
|
+
return [target + (off + pull * dt) * decay, (speed - GLIDE_RATE * pull * dt) * decay];
|
|
220
|
+
};
|
|
221
|
+
const settled = (target: GlideOffset) => Math.abs(x - target.x) < 1e-3 && Math.abs(y - target.y) < 1e-3 && Math.abs(vx) < 1e-2 && Math.abs(vy) < 1e-2;
|
|
222
|
+
return {
|
|
223
|
+
step(now, target) {
|
|
224
|
+
// A frame drawn late moves it no further than a tenth of a second would.
|
|
225
|
+
const dt = last === null ? 0 : Math.max(0, Math.min(0.1, (now - last) / 1000));
|
|
226
|
+
last = now;
|
|
227
|
+
[x, vx] = spring(x, vx, target.x, dt);
|
|
228
|
+
[y, vy] = spring(y, vy, target.y, dt);
|
|
229
|
+
if (settled(target)) {
|
|
230
|
+
x = target.x;
|
|
231
|
+
y = target.y;
|
|
232
|
+
vx = 0;
|
|
233
|
+
vy = 0;
|
|
234
|
+
}
|
|
235
|
+
return { x, y };
|
|
236
|
+
},
|
|
237
|
+
settled,
|
|
238
|
+
follow(draw) {
|
|
239
|
+
drawing = draw;
|
|
240
|
+
if (draw()) stop();
|
|
241
|
+
else frame ??= requestFrame(tick);
|
|
242
|
+
},
|
|
243
|
+
reset() {
|
|
244
|
+
stop();
|
|
245
|
+
x = 0;
|
|
246
|
+
y = 0;
|
|
247
|
+
vx = 0;
|
|
248
|
+
vy = 0;
|
|
249
|
+
last = null;
|
|
250
|
+
},
|
|
251
|
+
};
|
|
143
252
|
}
|
|
144
253
|
|
|
145
254
|
/**
|
|
@@ -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
|
-
|
|
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
|
|