gloomberb 0.19.4 → 0.19.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.
- package/package.json +3 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +86 -25
- package/src/api-client/equity-screener.ts +23 -0
- package/src/app/pane-runtime/index.tsx +2 -0
- package/src/app/pane-runtime/plugin-bindings.ts +10 -1
- package/src/app.tsx +63 -16
- package/src/cli/commands/command-utils.ts +4 -0
- package/src/cli/commands/market.ts +264 -33
- package/src/cli/commands/search.ts +22 -4
- package/src/cli/commands/ticker.ts +84 -39
- package/src/cli/currency-name-hint.ts +60 -0
- package/src/cli/glossary.ts +3 -3
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +25 -2
- package/src/cli/listing-arg.ts +12 -0
- package/src/cli/not-a-ticker.ts +5 -3
- package/src/cli/pane-functions/capabilities.ts +2 -0
- package/src/cli/pane-functions/catalog.ts +31 -5
- package/src/cli/pane-functions/function-help.ts +8 -5
- package/src/cli/pane-functions/headless.ts +11 -6
- package/src/cli/pane-functions/market-session.ts +6 -7
- package/src/cli/pane-functions/resolver.ts +75 -2
- package/src/cli/quote-answer.ts +9 -0
- package/src/cli/series-search.ts +4 -5
- package/src/cli/symbol-list.ts +54 -2
- package/src/cli/symbol-rows.ts +14 -2
- package/src/cli/ticker-resolution.ts +89 -20
- package/src/components/chart/composite/axis-overlays.tsx +60 -27
- package/src/components/chart/composite/composite-chart.tsx +118 -63
- package/src/components/chart/composite/cursor-source.ts +111 -0
- package/src/components/chart/composite/format.ts +168 -6
- package/src/components/chart/composite/legend.tsx +8 -4
- package/src/components/chart/composite/panel-bitmap.ts +28 -2
- package/src/components/chart/composite/panel-labels.ts +20 -1
- package/src/components/chart/composite/panel-surface.tsx +201 -92
- package/src/components/chart/composite/price-axis-labels.tsx +92 -46
- package/src/components/chart/composite/price-series.ts +31 -8
- package/src/components/chart/composite/scene.ts +154 -59
- package/src/components/chart/composite/series-axis-tags.tsx +4 -2
- package/src/components/chart/composite/time-axis.ts +30 -7
- package/src/components/chart/composite/time-scale.ts +211 -56
- package/src/components/chart/composite/types.ts +11 -1
- package/src/components/chart/composite/use-composite-chart-keyboard.ts +32 -12
- package/src/components/chart/curve/curve-surface.tsx +5 -2
- package/src/components/chart/curve/model.ts +4 -1
- package/src/components/chart/native/use-bitmap-metrics.ts +81 -0
- package/src/components/chart/static/series.ts +3 -0
- package/src/components/command-bar/commands/collection-list.ts +81 -0
- package/src/components/command-bar/commands/direct/index.ts +6 -0
- package/src/components/command-bar/commands/registry.ts +8 -0
- package/src/components/command-bar/layout-items/current-layout.ts +22 -1
- package/src/components/command-bar/layout-items/focused-pane.ts +22 -1
- package/src/components/command-bar/pane-templates/items.ts +19 -3
- package/src/components/command-bar/pane-templates/workflow.ts +5 -0
- package/src/components/command-bar/routes/root/results.ts +23 -3
- package/src/components/command-bar/routes/root/selection.ts +4 -2
- package/src/components/command-bar/routes/root/shortcut-feedback.ts +1 -1
- package/src/components/command-bar/routes/root/shortcut-items.ts +3 -4
- package/src/components/command-bar/routes/root/shortcuts.ts +58 -14
- package/src/components/command-bar/routes/root/ticker-first.ts +32 -0
- package/src/components/command-bar/surface/environment.ts +2 -0
- package/src/components/command-bar/view-model.ts +7 -0
- package/src/components/command-bar/workflow/ops.ts +2 -1
- package/src/components/command-bar/workflow/tickers.ts +20 -0
- package/src/components/layout/shell/active-drag.ts +38 -7
- package/src/components/layout/shell/drag/magnets.ts +106 -0
- package/src/components/layout/shell/menu.ts +15 -1
- package/src/components/layout/shell/pane/actions.ts +4 -0
- package/src/components/layout/shell/ticker-link-menu.ts +12 -3
- package/src/components/layout/status-bar.tsx +20 -0
- package/src/components/layout/window-controls.tsx +96 -35
- package/src/components/layout/window-fullscreen.ts +20 -0
- package/src/components/onboarding/onboarding-keyboard.ts +5 -1
- package/src/components/onboarding/onboarding-wizard.tsx +15 -4
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +8 -5
- package/src/components/onboarding/use-onboarding-progress.ts +20 -1
- package/src/components/price-sparkline/view.tsx +14 -6
- package/src/components/quote-flash.ts +36 -32
- package/src/components/ticker/badge/index.tsx +8 -4
- package/src/components/ticker/badge/list.tsx +23 -7
- package/src/components/ui/column-grid.tsx +8 -2
- package/src/components/ui/data-table/opentui/model.ts +4 -1
- package/src/components/ui/tabs.tsx +5 -2
- package/src/core/state/app/layout.ts +18 -3
- package/src/core/state/app/state.ts +2 -0
- package/src/core/state/app/types.ts +5 -0
- package/src/data/config/layout.ts +3 -0
- package/src/data/config/store/normalize.ts +39 -4
- package/src/i18n/es.ts +10 -0
- package/src/i18n/ja.ts +10 -0
- package/src/i18n/ko.ts +10 -0
- package/src/i18n/zh-cn.ts +10 -0
- package/src/i18n/zh-tw.ts +10 -0
- package/src/layout/pane-manager/floating-placement.ts +7 -4
- package/src/layout/pane-manager/floating.ts +5 -2
- package/src/market-data/bond-funds.ts +19 -0
- package/src/market-data/coordinator/events.ts +17 -1
- package/src/market-data/frame-scheduler.ts +47 -10
- package/src/market-data/frame-wake.ts +74 -0
- package/src/market-data/futures-board.ts +7 -6
- package/src/market-data/futures-contract.ts +14 -3
- package/src/market-data/hooks.tsx +12 -3
- package/src/market-data/market/freshness.ts +18 -0
- package/src/market-data/market/status.ts +15 -2
- package/src/market-data/performance.ts +78 -9
- package/src/market-data/request-types.ts +6 -3
- package/src/plugins/builtin/alerts/cli.ts +2 -1
- package/src/plugins/builtin/analytics/risk-evidence.ts +1 -0
- package/src/plugins/builtin/attention/evidence.ts +1 -1
- package/src/plugins/builtin/awards/client.ts +1 -1
- package/src/plugins/builtin/awards/evidence.ts +1 -1
- package/src/plugins/builtin/awards/pane.tsx +2 -1
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/index.tsx +1 -1
- package/src/plugins/builtin/bond-calculator/math.ts +1 -1
- package/src/plugins/builtin/bond-calculator/model.ts +14 -5
- package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/broker-manager/footer.ts +3 -2
- package/src/plugins/builtin/broker-manager/index.tsx +2 -1
- package/src/plugins/builtin/broker-manager/keyboard.ts +2 -1
- package/src/plugins/builtin/buildout/cells.tsx +25 -45
- package/src/plugins/builtin/buildout/detail/company.tsx +3 -3
- package/src/plugins/builtin/buildout/detail/index.tsx +1 -1
- package/src/plugins/builtin/buildout/detail/intel.tsx +4 -7
- package/src/plugins/builtin/buildout/detail/site.tsx +4 -4
- package/src/plugins/builtin/buildout/detail/ui.tsx +39 -38
- package/src/plugins/builtin/buildout/format.ts +23 -1
- package/src/plugins/builtin/buildout/model/types.ts +1 -0
- package/src/plugins/builtin/buildout/pane/index.tsx +2 -8
- package/src/plugins/builtin/buildout/table-model.ts +12 -4
- package/src/plugins/builtin/catalysts/evidence.ts +1 -1
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +1 -0
- package/src/plugins/builtin/cds/index.tsx +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +40 -1
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +28 -3
- package/src/plugins/builtin/cloud-tweets/table.tsx +3 -2
- package/src/plugins/builtin/comment-letters/client.ts +2 -1
- package/src/plugins/builtin/company-kpis/client.ts +1 -1
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -1
- package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +3 -2
- package/src/plugins/builtin/correlation/headless.ts +3 -2
- package/src/plugins/builtin/cot/headless.ts +9 -3
- package/src/plugins/builtin/cot/model.ts +44 -3
- package/src/plugins/builtin/credit-documents/client.ts +1 -1
- package/src/plugins/builtin/credit-documents/evidence.ts +1 -1
- package/src/plugins/builtin/credit-documents/pane.tsx +2 -1
- package/src/plugins/builtin/crypto-board/pane.tsx +5 -4
- package/src/plugins/builtin/debt-maturities/headless.ts +11 -2
- package/src/plugins/builtin/debt-maturities/model.ts +66 -0
- package/src/plugins/builtin/debt-maturities/pane.tsx +23 -4
- package/src/plugins/builtin/earnings-calls/pane.tsx +1 -1
- package/src/plugins/builtin/earnings-ripple/index.tsx +6 -1
- package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +30 -6
- package/src/plugins/builtin/econ/fred-catalog.ts +5 -5
- package/src/plugins/builtin/econ/print-watch.ts +3 -1
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +4 -16
- package/src/plugins/builtin/equity-screener/headless.ts +4 -2
- package/src/plugins/builtin/equity-screener/ideas.ts +67 -3
- package/src/plugins/builtin/equity-screener/model.ts +180 -12
- package/src/plugins/builtin/equity-screener/pane.tsx +52 -12
- package/src/plugins/builtin/equity-screener/screen-check.ts +7 -4
- package/src/plugins/builtin/equity-screener/watchlist.ts +33 -0
- package/src/plugins/builtin/futures/series.ts +16 -1
- package/src/plugins/builtin/futures-curve/client.ts +19 -0
- package/src/plugins/builtin/futures-curve/headless.ts +52 -13
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +77 -6
- package/src/plugins/builtin/futures-curve/pane.tsx +19 -3
- package/src/plugins/builtin/fx-matrix/headless.ts +4 -2
- package/src/plugins/builtin/fx-matrix/index.tsx +37 -3
- package/src/plugins/builtin/fx-matrix/pairs.ts +15 -0
- package/src/plugins/builtin/gpu/headless.ts +2 -1
- package/src/plugins/builtin/help/function-card.tsx +2 -1
- package/src/plugins/builtin/help/index.tsx +2 -1
- package/src/plugins/builtin/insider/display.ts +45 -6
- package/src/plugins/builtin/ipo-calendar/model.ts +2 -0
- package/src/plugins/builtin/iv-history/client.ts +2 -1
- package/src/plugins/builtin/iv-history/headless.ts +2 -1
- package/src/plugins/builtin/jobs/pages.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/headless.ts +2 -1
- package/src/plugins/builtin/macro-day/client.ts +41 -0
- package/src/plugins/builtin/macro-day/headless.ts +19 -9
- package/src/plugins/builtin/macro-day/model.ts +3 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +2 -1
- package/src/plugins/builtin/market-movers/index.tsx +4 -3
- package/src/plugins/builtin/members/client.ts +1 -1
- package/src/plugins/builtin/mna/distress/client.ts +1 -0
- package/src/plugins/builtin/mna/distress/headless.ts +1 -0
- package/src/plugins/builtin/mna/pane.tsx +4 -1
- package/src/plugins/builtin/options/market-reference.ts +1 -1
- package/src/plugins/builtin/options/open-interest-as-of.ts +3 -1
- package/src/plugins/builtin/options/view.tsx +2 -1
- package/src/plugins/builtin/options-calculator/evidence.ts +1 -1
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/csp-screen.ts +8 -4
- package/src/plugins/builtin/options-scenario/csp.ts +28 -9
- package/src/plugins/builtin/options-scenario/evidence.ts +5 -4
- package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
- package/src/plugins/builtin/perps/client.ts +1 -1
- package/src/plugins/builtin/perps/pane.tsx +3 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +17 -0
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +2 -1
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +7 -3
- package/src/plugins/builtin/portfolio-list/use-throttled-memo.ts +10 -19
- package/src/plugins/builtin/rate-path/headless.ts +24 -10
- package/src/plugins/builtin/research/analyst-model.ts +1 -0
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +2 -1
- package/src/plugins/builtin/research/event-model.ts +10 -3
- package/src/plugins/builtin/research/events-headless.ts +20 -2
- package/src/plugins/builtin/research/index.tsx +1 -0
- package/src/plugins/builtin/research/relative-valuation-currency.ts +1 -1
- package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -1
- package/src/plugins/builtin/research-search/command-bar-search.ts +3 -1
- package/src/plugins/builtin/research-search/snippet.ts +1 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +3 -2
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/sec/command-bar-search.ts +3 -2
- package/src/plugins/builtin/sec/fund-facts.ts +17 -1
- package/src/plugins/builtin/sec/index.tsx +8 -5
- package/src/plugins/builtin/sec/row-summaries.ts +28 -12
- package/src/plugins/builtin/shared/members-menu.tsx +103 -38
- package/src/plugins/builtin/short-interest/publications-model.ts +22 -1
- package/src/plugins/builtin/short-interest/publications-pane.tsx +13 -4
- package/src/plugins/builtin/short-interest/watch-client.ts +2 -1
- package/src/plugins/builtin/short-interest/watch-model.ts +1 -1
- package/src/plugins/builtin/social-mentions/client.ts +2 -1
- package/src/plugins/builtin/supply-chain/client.ts +1 -1
- package/src/plugins/builtin/supply-chain/evidence.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -1
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +1 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +24 -4
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +1 -1
- package/src/plugins/builtin/time-sales/client.ts +1 -0
- package/src/plugins/builtin/time-sales/pane.tsx +3 -2
- package/src/plugins/builtin/trace-bonds/client.ts +7 -4
- package/src/plugins/builtin/trace-bonds/index.tsx +1 -1
- package/src/plugins/builtin/vol-surface/client.ts +2 -1
- package/src/plugins/builtin/volatility/client.ts +6 -1
- package/src/plugins/builtin/volatility/headless.ts +0 -1
- package/src/plugins/builtin/yield-curve/curves.ts +15 -0
- package/src/plugins/builtin/yield-curve/headless.ts +9 -2
- package/src/plugins/builtin/yield-curve/index.tsx +5 -8
- package/src/plugins/host-modules.ts +22 -3
- package/src/plugins/host-smoke.ts +6 -3
- package/src/portfolio/collection-name.ts +19 -0
- package/src/portfolio/column-values.ts +76 -10
- package/src/renderers/browser/http-proxy-transport.ts +78 -8
- package/src/renderers/cloudflare/http-proxy.ts +13 -2
- package/src/renderers/cloudflare/proxy-session.ts +47 -24
- package/src/renderers/cloudflare/worker.ts +15 -2
- package/src/renderers/desktop/geometry.ts +279 -0
- package/src/renderers/desktop/screen-setup.ts +246 -0
- package/src/renderers/desktop/sequential-window-host.ts +179 -0
- package/src/renderers/desktop/test-utils.ts +71 -0
- package/src/renderers/desktop/window-controller.ts +433 -0
- package/src/renderers/desktop/window-host.ts +70 -0
- package/src/renderers/desktop/window-layouts.ts +630 -0
- package/src/renderers/dom/data-frames.ts +15 -4
- package/src/renderers/dom/host/box.tsx +204 -176
- package/src/renderers/dom/host/style.ts +49 -20
- package/src/renderers/dom/host/text.tsx +3 -2
- package/src/renderers/electrobun/bun/application-menu/click.ts +1 -0
- package/src/renderers/electrobun/bun/application-menu/index.ts +4 -1
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +19 -8
- package/src/renderers/electrobun/bun/desktop/backend.ts +322 -19
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +83 -61
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +29 -15
- package/src/renderers/electrobun/bun/desktop/initialization.ts +30 -11
- package/src/renderers/electrobun/bun/desktop/relaunch.ts +9 -1
- package/src/renderers/electrobun/bun/desktop/screen-setup-file.ts +55 -0
- package/src/renderers/electrobun/bun/desktop/state-broadcaster.ts +44 -8
- package/src/renderers/electrobun/bun/desktop/windows-script.ts +9 -6
- package/src/renderers/electrobun/bun/desktop/workspace/index.ts +298 -97
- package/src/renderers/electrobun/bun/desktop/workspace/requests.ts +44 -6
- package/src/renderers/electrobun/bun/index.ts +4 -97
- package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +306 -0
- package/src/renderers/electrobun/bun/window/focus.ts +0 -25
- package/src/renderers/electrobun/bun/window/remembered-frame.ts +4 -82
- package/src/renderers/electrobun/bun/window/windows-native.ts +26 -1
- package/src/renderers/electrobun/shared/protocol.ts +50 -2
- package/src/renderers/electrobun/view/backend-rpc.ts +15 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +63 -3
- package/src/renderers/electrobun/view/main.tsx +13 -7
- package/src/renderers/electrobun/view/ui-host.tsx +7 -0
- package/src/renderers/electrobun/view/window-fullscreen.ts +10 -3
- package/src/series/fred-argument.ts +17 -0
- package/src/sources/provider-router/financial-routes.ts +7 -1
- package/src/sources/provider-router/index.ts +7 -1
- package/src/state/app/context/index.tsx +16 -2
- package/src/state/desktop-windows.ts +63 -0
- package/src/sync/other-window-tabs.ts +62 -0
- package/src/tickers/company-name-listing.ts +23 -3
- package/src/tickers/listing-fate.ts +147 -1
- package/src/tickers/terminal-codes.ts +5 -0
- package/src/time-series/price-units.ts +11 -0
- package/src/time-series/types.ts +6 -0
- package/src/types/config.ts +10 -1
- package/src/types/desktop-window.ts +71 -2
- package/src/types/financials.ts +4 -0
- package/src/types/headless.ts +19 -0
- package/src/types/plugin.ts +6 -0
- package/src/ui/host.tsx +2 -0
- package/src/ui/index.tsx +14 -13
- package/src/ui/same-props.ts +58 -0
- package/src/utils/cli-output.ts +33 -4
- package/src/utils/currency-names.ts +20 -0
- package/src/utils/currency-pair.ts +6 -0
- package/src/utils/exchange-rate-snapshot.ts +20 -2
- package/src/utils/format.ts +7 -2
- package/src/utils/futures-generic.ts +12 -0
- package/src/utils/fx-market-hours.ts +43 -0
- package/src/utils/http-proxy-upstream.ts +6 -2
- package/src/utils/plugin-proxy-hosts.json +0 -4
- package/src/utils/plugin-proxy-hosts.ts +22 -0
- package/src/utils/sec-filings.ts +7 -1
|
@@ -31,7 +31,15 @@ import {
|
|
|
31
31
|
} from "./drag";
|
|
32
32
|
import type { ShellDragRuntimeState, ShellMouseEvent } from "./drag/runtime";
|
|
33
33
|
import type { WindowEditState } from "../window-edit/mode";
|
|
34
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
createMagnetPace,
|
|
36
|
+
NO_LATCH,
|
|
37
|
+
snapMovedRect,
|
|
38
|
+
snapResizedRect,
|
|
39
|
+
type MagnetDistances,
|
|
40
|
+
type MagnetLatch,
|
|
41
|
+
type MagnetPace,
|
|
42
|
+
} from "./drag/magnets";
|
|
35
43
|
import { paneHeaderRows } from "../pane/sizing";
|
|
36
44
|
|
|
37
45
|
/** A join the pointer has lined up: armed once it has held for JOIN_DWELL_MS. */
|
|
@@ -100,8 +108,10 @@ export function useShellActiveDrag({
|
|
|
100
108
|
} = dragRuntime;
|
|
101
109
|
// What one drag keeps between moves: a docked pane's floating size, the
|
|
102
110
|
// last drop it simulated, so a move over the same target computes nothing,
|
|
103
|
-
// the edges its magnets hold, with the other panes' rects they hold to,
|
|
104
|
-
//
|
|
111
|
+
// the edges its magnets hold, with the other panes' rects they hold to, the
|
|
112
|
+
// join it is holding still for, and on the desktop where the pointer has
|
|
113
|
+
// been lately (the magnets wait for it to slow down) with the check that
|
|
114
|
+
// catches once it rests.
|
|
105
115
|
const memoRef = useRef<{
|
|
106
116
|
drag: unknown;
|
|
107
117
|
baseRect: FloatingRect | null;
|
|
@@ -110,10 +120,16 @@ export function useShellActiveDrag({
|
|
|
110
120
|
latch: MagnetLatch;
|
|
111
121
|
magnetTargets: LayoutBounds[] | null;
|
|
112
122
|
join: PendingJoin | null;
|
|
113
|
-
|
|
114
|
-
|
|
123
|
+
pace: MagnetPace;
|
|
124
|
+
}>({ drag: null, baseRect: null, dropKey: null, drop: null, latch: NO_LATCH, magnetTargets: null, join: null, pace: createMagnetPace() });
|
|
125
|
+
useEffect(() => () => {
|
|
126
|
+
dropPendingJoin(memoRef.current);
|
|
127
|
+
memoRef.current.pace.reset();
|
|
128
|
+
}, []);
|
|
129
|
+
// The handler as it is now, for the rest check to run again.
|
|
130
|
+
const handleRef = useRef<(event: ShellMouseEvent) => void>(() => {});
|
|
115
131
|
|
|
116
|
-
|
|
132
|
+
const handle = useCallback((event: ShellMouseEvent) => {
|
|
117
133
|
const shellY = event.y - appHeaderHeight;
|
|
118
134
|
const preciseX = event.preciseX ?? event.x;
|
|
119
135
|
const preciseShellY = (event.preciseY ?? event.y) - appHeaderHeight;
|
|
@@ -135,8 +151,11 @@ export function useShellActiveDrag({
|
|
|
135
151
|
memo.drop = null;
|
|
136
152
|
memo.latch = NO_LATCH;
|
|
137
153
|
memo.magnetTargets = null;
|
|
154
|
+
memo.pace.reset();
|
|
138
155
|
dropPendingJoin(memo);
|
|
139
156
|
}
|
|
157
|
+
// Any later event supersedes the rest check of an earlier move.
|
|
158
|
+
memo.pace.cancel();
|
|
140
159
|
// Every other pane on screen, docked or floating, whose edges a floating
|
|
141
160
|
// pane's edges stick to. Alt (Option) lets it go anywhere.
|
|
142
161
|
const magnetTargets = (paneId: string) => {
|
|
@@ -150,6 +169,16 @@ export function useShellActiveDrag({
|
|
|
150
169
|
};
|
|
151
170
|
const magnetsOff = event.modifiers?.alt === true;
|
|
152
171
|
const magnetArea = { x: 0, y: 0, width, height: contentHeight };
|
|
172
|
+
// Desktop: while the pointer travels, a moving pane follows it exactly;
|
|
173
|
+
// its magnets catch once it slows down near a line, or rests there (the
|
|
174
|
+
// rest check runs the last move again once the pointer has stopped). What
|
|
175
|
+
// they hold to still follows every move, so it rests where it would have.
|
|
176
|
+
const travelling = () => {
|
|
177
|
+
if (!nativePaneChrome || drag.type !== "pane-drag") return false;
|
|
178
|
+
// A release lands where the pane is drawn: no catch after it.
|
|
179
|
+
const rest = event.type === "drag" ? () => { if (dragRef.current === drag) handleRef.current(event); } : undefined;
|
|
180
|
+
return memo.pace.travelling({ t: performance.now(), x: preciseX, y: preciseShellY }, magnetDistances, rest);
|
|
181
|
+
};
|
|
153
182
|
const snapMove = (paneId: string, rect: FloatingRect): FloatingRect => {
|
|
154
183
|
if (magnetsOff) {
|
|
155
184
|
memo.latch = NO_LATCH;
|
|
@@ -157,7 +186,7 @@ export function useShellActiveDrag({
|
|
|
157
186
|
}
|
|
158
187
|
const snapped = snapMovedRect(rect, magnetTargets(paneId), magnetArea, magnetDistances, memo.latch);
|
|
159
188
|
memo.latch = snapped.latch;
|
|
160
|
-
return snapped.rect;
|
|
189
|
+
return travelling() ? rect : snapped.rect;
|
|
161
190
|
};
|
|
162
191
|
const snapResize = (paneId: string, rect: FloatingRect, edges: { x: -1 | 0 | 1; y: -1 | 0 | 1 }): FloatingRect => {
|
|
163
192
|
if (magnetsOff) {
|
|
@@ -364,4 +393,6 @@ export function useShellActiveDrag({
|
|
|
364
393
|
windowMode,
|
|
365
394
|
width,
|
|
366
395
|
]);
|
|
396
|
+
handleRef.current = handle;
|
|
397
|
+
return handle;
|
|
367
398
|
}
|
|
@@ -36,6 +36,112 @@ const MAGNET_RELEASE_PX = 12;
|
|
|
36
36
|
/** Terminal magnets, in cells: the next cell catches, two let go. */
|
|
37
37
|
const TERMINAL_MAGNETS: MagnetDistances = { catchX: 1, catchY: 1, releaseX: 2, releaseY: 2 };
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Desktop: a moving pane's magnets act while the pointer slows down or rests
|
|
41
|
+
* near a line; faster than this, in catch distances a second (300 px/s), the
|
|
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.
|
|
45
|
+
*/
|
|
46
|
+
const MAGNET_TRAVEL_SPEED = 300 / MAGNET_CATCH_PX;
|
|
47
|
+
/** How far back the pointer's speed is read, ms: a few frames. */
|
|
48
|
+
const SPEED_WINDOW_MS = 64;
|
|
49
|
+
/** How long the pointer rests before the magnets catch where it stopped, ms. */
|
|
50
|
+
export const MAGNET_REST_MS = 80;
|
|
51
|
+
|
|
52
|
+
/** Where the pointer was during a move, in cells, and when (ms). */
|
|
53
|
+
interface PointerSample {
|
|
54
|
+
t: number;
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Adds where the pointer is now, keeping only what the speed reads. */
|
|
60
|
+
function trackPointer(track: PointerSample[], sample: PointerSample): void {
|
|
61
|
+
track.push(sample);
|
|
62
|
+
const oldest = sample.t - SPEED_WINDOW_MS * 2;
|
|
63
|
+
while (track.length > 2 && track[1]!.t <= oldest) track.shift();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Desktop: when a moving pane's magnets act, over one drag. `travelling`
|
|
68
|
+
* takes each move and says whether the pointer is on its way somewhere; while
|
|
69
|
+
* it is, the pane follows it exactly, and `rest` (the move run again) is set
|
|
70
|
+
* to run once the pointer has stopped for MAGNET_REST_MS, so the magnets
|
|
71
|
+
* catch where it stopped. Any later move drops that check, travelling or not:
|
|
72
|
+
* run after a slower move, it would put the pane back where the pointer was.
|
|
73
|
+
* The check runs at the start of a frame, after the moves that frame brings,
|
|
74
|
+
* so a page drawing fewer frames than 1 / MAGNET_REST_MS still sees a
|
|
75
|
+
* pointer that moves on every frame as travelling.
|
|
76
|
+
*/
|
|
77
|
+
export interface MagnetPace {
|
|
78
|
+
travelling(sample: PointerSample, distances: MagnetDistances, rest?: () => void): boolean;
|
|
79
|
+
/** Drops the rest check: another event of the drag came first. */
|
|
80
|
+
cancel(): void;
|
|
81
|
+
/** Forgets the pointer's path, for a new drag. */
|
|
82
|
+
reset(): void;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function createMagnetPace(): MagnetPace {
|
|
86
|
+
let track: PointerSample[] = [];
|
|
87
|
+
let rest: ReturnType<typeof setTimeout> | null = null;
|
|
88
|
+
let frame: number | null = null;
|
|
89
|
+
const cancel = () => {
|
|
90
|
+
if (rest) clearTimeout(rest);
|
|
91
|
+
if (frame !== null) cancelAnimationFrame(frame);
|
|
92
|
+
rest = null;
|
|
93
|
+
frame = null;
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
travelling(sample, distances, onRest) {
|
|
97
|
+
cancel();
|
|
98
|
+
const last = track[track.length - 1];
|
|
99
|
+
// The same place again (a rest check, a repeated event) is not a move.
|
|
100
|
+
if (!last || last.x !== sample.x || last.y !== sample.y) trackPointer(track, sample);
|
|
101
|
+
if (!pointerTravelling(track, sample.t, distances)) return false;
|
|
102
|
+
if (onRest) {
|
|
103
|
+
rest = setTimeout(() => {
|
|
104
|
+
rest = null;
|
|
105
|
+
if (typeof requestAnimationFrame !== "function") return onRest();
|
|
106
|
+
frame = requestAnimationFrame(() => {
|
|
107
|
+
frame = null;
|
|
108
|
+
onRest();
|
|
109
|
+
});
|
|
110
|
+
}, MAGNET_REST_MS);
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
},
|
|
114
|
+
cancel,
|
|
115
|
+
reset() {
|
|
116
|
+
cancel();
|
|
117
|
+
track = [];
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Whether the pointer is on its way somewhere rather than placing the pane:
|
|
124
|
+
* how far it went over the last few frames, in catch distances a second,
|
|
125
|
+
* against the travel speed. A move with nothing before it (the first of a
|
|
126
|
+
* drag) is travel, so a pane leaves its spot without catching the lines it
|
|
127
|
+
* sits on.
|
|
128
|
+
*/
|
|
129
|
+
function pointerTravelling(track: readonly PointerSample[], now: number, distances: MagnetDistances): boolean {
|
|
130
|
+
const latest = track[track.length - 1];
|
|
131
|
+
if (!latest) return false;
|
|
132
|
+
const since = now - SPEED_WINDOW_MS;
|
|
133
|
+
let from = track[0]!;
|
|
134
|
+
for (const sample of track) {
|
|
135
|
+
if (sample.t > since) break;
|
|
136
|
+
from = sample;
|
|
137
|
+
}
|
|
138
|
+
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 true;
|
|
141
|
+
const catches = Math.hypot((latest.x - from.x) / distances.catchX, (latest.y - from.y) / distances.catchY);
|
|
142
|
+
return (catches / span) * 1000 > MAGNET_TRAVEL_SPEED;
|
|
143
|
+
}
|
|
144
|
+
|
|
39
145
|
/**
|
|
40
146
|
* The magnets in cells: the desktop's px over its cell size (`cell`), or the
|
|
41
147
|
* terminal's whole cells, also for a cell size not measured yet (zero), which
|
|
@@ -19,6 +19,7 @@ import { PANE_MANAGEMENT_ACCELERATORS, type PaneManagementAccelerators } from ".
|
|
|
19
19
|
import { t, tf } from "../../../i18n";
|
|
20
20
|
import { displayWidth } from "../../../utils/format";
|
|
21
21
|
import { fireAndForget } from "../../../utils/fire-and-forget";
|
|
22
|
+
import { getDesktopWindows, windowMoveTargets } from "../../../state/desktop-windows";
|
|
22
23
|
|
|
23
24
|
const MENU_MIN_WIDTH = 18;
|
|
24
25
|
const MENU_MAX_WIDTH = 44;
|
|
@@ -217,7 +218,9 @@ export function menuForPane(
|
|
|
217
218
|
});
|
|
218
219
|
}
|
|
219
220
|
|
|
220
|
-
|
|
221
|
+
// Popped-out panes belong to the main window; elsewhere a pane moves to a window instead.
|
|
222
|
+
const windows = getDesktopWindows();
|
|
223
|
+
if (desktopWindowBridge?.kind === "main" && desktopWindowBridge.popOutPane && (!windows || windows.windowId === "main")) {
|
|
221
224
|
baseActions.push({
|
|
222
225
|
id: "pop-out",
|
|
223
226
|
label: "Pop Out",
|
|
@@ -227,6 +230,17 @@ export function menuForPane(
|
|
|
227
230
|
},
|
|
228
231
|
});
|
|
229
232
|
}
|
|
233
|
+
if (windows) {
|
|
234
|
+
for (const move of windowMoveTargets(windows, { prefix: "pane" })) {
|
|
235
|
+
baseActions.push({
|
|
236
|
+
id: `move-to-window:${move.key}`,
|
|
237
|
+
label: move.label,
|
|
238
|
+
onSelect: () => {
|
|
239
|
+
fireAndForget(windows.movePane(pane.instance.instanceId, move.target), "desktop.movePaneToWindow");
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
230
244
|
|
|
231
245
|
const locked = isPaneLocked(pane.instance);
|
|
232
246
|
baseActions.push({
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
exportPaneTableCsv,
|
|
21
21
|
hasPaneTableExporter,
|
|
22
22
|
} from "../../../../state/pane-table-export-registry";
|
|
23
|
+
import { getDesktopWindows } from "../../../../state/desktop-windows";
|
|
23
24
|
|
|
24
25
|
function notifyPaneLocked(pluginRegistry: PluginRegistry): void {
|
|
25
26
|
pluginRegistry.notify({ body: "Pane is locked. Unlock it in pane settings.", type: "info" });
|
|
@@ -177,6 +178,9 @@ export function useShellPaneActions({
|
|
|
177
178
|
|
|
178
179
|
const popOutFocusedPane = useCallback(() => {
|
|
179
180
|
if (!focusedPaneId || desktopWindowBridge?.kind !== "main" || !desktopWindowBridge.popOutPane) return false;
|
|
181
|
+
// Only the main window pops panes out.
|
|
182
|
+
const windows = getDesktopWindows();
|
|
183
|
+
if (windows && windows.windowId !== "main") return false;
|
|
180
184
|
if (!isPaneInLayout(visibleLayout, focusedPaneId)) return false;
|
|
181
185
|
const shot = shots.get("pop-out");
|
|
182
186
|
if (shot.refuses()) return true;
|
|
@@ -10,6 +10,7 @@ import { resolveTickerForPane, type AppState } from "../../../state/app/context"
|
|
|
10
10
|
import { resolveInstrumentForPane } from "../../../core/state/app/instrument";
|
|
11
11
|
import { paneTitleMnemonic, pinFollowingPane } from "../../../layout/pane-follow";
|
|
12
12
|
import {
|
|
13
|
+
findPaneInstance,
|
|
13
14
|
TICKER_RESEARCH_PANE_ID,
|
|
14
15
|
type LayoutConfig,
|
|
15
16
|
type PaneInstanceConfig,
|
|
@@ -34,7 +35,7 @@ export function tickerLinkMenuItems({
|
|
|
34
35
|
instance: PaneInstanceConfig;
|
|
35
36
|
layout: LayoutConfig;
|
|
36
37
|
panes: ReadonlyMap<string, PaneDef>;
|
|
37
|
-
state: Pick<AppState, "config" | "paneState" | "tickers">;
|
|
38
|
+
state: Pick<AppState, "config" | "paneState" | "tickers" | "linkedTickers">;
|
|
38
39
|
persistLayout: (nextLayout: LayoutConfig) => void;
|
|
39
40
|
}): ContextMenuItem[] {
|
|
40
41
|
const research = instance.paneId === TICKER_RESEARCH_PANE_ID;
|
|
@@ -77,7 +78,15 @@ export function tickerLinkMenuItems({
|
|
|
77
78
|
});
|
|
78
79
|
};
|
|
79
80
|
|
|
80
|
-
|
|
81
|
+
// A source in another desktop window is not in this layout to list; the link can still be cut.
|
|
82
|
+
const remoteSymbol = sourceInstanceId && !findPaneInstance(layout, sourceInstanceId)
|
|
83
|
+
? resolveTickerForPane(state as AppState, instance.instanceId)
|
|
84
|
+
: null;
|
|
85
|
+
const remoteUnlink: ContextMenuItem[] = remoteSymbol
|
|
86
|
+
? [{ id: `unlink:${sourceInstanceId}`, label: "Unlink from Pane in Another Window", onSelect: () => unlink(remoteSymbol) }]
|
|
87
|
+
: [];
|
|
88
|
+
|
|
89
|
+
return [...remoteUnlink, ...layout.instances.flatMap((source): ContextMenuItem[] => {
|
|
81
90
|
if (source.instanceId === instance.instanceId || !isPaneInLayout(layout, source.instanceId)) return [];
|
|
82
91
|
const sourceDef = panes.get(source.paneId);
|
|
83
92
|
if (!sourceDef) return [];
|
|
@@ -111,5 +120,5 @@ export function tickerLinkMenuItems({
|
|
|
111
120
|
onSelect: () => unlink(symbol),
|
|
112
121
|
}]
|
|
113
122
|
: [];
|
|
114
|
-
});
|
|
123
|
+
})];
|
|
115
124
|
}
|
|
@@ -48,6 +48,8 @@ import { teamStore } from "../../team/store";
|
|
|
48
48
|
import { buildStatusBarTabGroups, groupIdFromMarkerValue, groupMarkerValue } from "./status-bar-groups";
|
|
49
49
|
import { requestFeedbackDialog } from "../feedback-dialog";
|
|
50
50
|
import { openFormModal } from "../form-modal";
|
|
51
|
+
import { getDesktopWindows, layoutMoveTargets } from "../../state/desktop-windows";
|
|
52
|
+
import { fireAndForget } from "../../utils/fire-and-forget";
|
|
51
53
|
import { recordFunctionOpen } from "../../telemetry/usage-counts";
|
|
52
54
|
import {
|
|
53
55
|
STATUS_WIDGET_COLUMNS,
|
|
@@ -362,6 +364,24 @@ export function StatusBar({ onOpenChangelog }: { onOpenChangelog?: (version: str
|
|
|
362
364
|
enabled: layouts.length > 1,
|
|
363
365
|
onSelect: () => requestDeleteLayout(index),
|
|
364
366
|
},
|
|
367
|
+
);
|
|
368
|
+
// The desktop app's other windows, where the tab can go.
|
|
369
|
+
const windows = getDesktopWindows();
|
|
370
|
+
const layoutId = layout.id;
|
|
371
|
+
if (windows && layoutId) {
|
|
372
|
+
const moves = layoutMoveTargets(windows, layouts.length);
|
|
373
|
+
if (moves.length > 0) items.push(contextMenuDivider("layout:window-divider"));
|
|
374
|
+
for (const move of moves) {
|
|
375
|
+
items.push({
|
|
376
|
+
id: `layout:move-to-window:${move.key}`,
|
|
377
|
+
label: move.label,
|
|
378
|
+
onSelect: () => {
|
|
379
|
+
fireAndForget(windows.moveLayout(layoutId, move.target), "desktop.moveLayoutToWindow");
|
|
380
|
+
},
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
items.push(
|
|
365
385
|
contextMenuDivider("layout:actions-divider"),
|
|
366
386
|
{
|
|
367
387
|
id: "layout:gallery",
|
|
@@ -3,6 +3,7 @@ import { useCallback } from "react";
|
|
|
3
3
|
import { t } from "../../i18n";
|
|
4
4
|
import { useAppLanguage } from "../../i18n/react";
|
|
5
5
|
import { TITLEBAR_OVERLAY_HEIGHT_PX } from "./titlebar-overlay";
|
|
6
|
+
import { useWindowMaximized } from "./window-fullscreen";
|
|
6
7
|
|
|
7
8
|
const WINDOWS_CONTROL_SIZE_PX = TITLEBAR_OVERLAY_HEIGHT_PX;
|
|
8
9
|
export const WINDOWS_CONTROL_GROUP_WIDTH_PX = WINDOWS_CONTROL_SIZE_PX * 3;
|
|
@@ -47,58 +48,118 @@ function WindowControlIcon({ action }: { action: WindowControlAction }) {
|
|
|
47
48
|
);
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The page covers the top of its window's frame, so the strip along its top
|
|
53
|
+
* stands in for the frame's top edge: a press there resizes the window, and at
|
|
54
|
+
* either end diagonally, as Windows does from a native frame.
|
|
55
|
+
*/
|
|
56
|
+
const TOP_EDGE_HEIGHT_PX = 4;
|
|
57
|
+
const TOP_CORNER_WIDTH_PX = 16;
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
useAppLanguage();
|
|
56
|
-
const rendererHost = useRendererHost();
|
|
59
|
+
type TopEdge = "top" | "top-left" | "top-right";
|
|
57
60
|
|
|
58
|
-
|
|
61
|
+
const TOP_EDGES: Array<{ edge: TopEdge; cursor: string; width?: number }> = [
|
|
62
|
+
{ edge: "top-left", cursor: "nwse-resize", width: TOP_CORNER_WIDTH_PX },
|
|
63
|
+
{ edge: "top", cursor: "ns-resize" },
|
|
64
|
+
{ edge: "top-right", cursor: "nesw-resize", width: TOP_CORNER_WIDTH_PX },
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
function WindowTopEdge() {
|
|
68
|
+
const rendererHost = useRendererHost();
|
|
69
|
+
// A maximized window has no edge to pull, and its buttons must take a press
|
|
70
|
+
// at the screen's very top.
|
|
71
|
+
const maximized = useWindowMaximized();
|
|
72
|
+
const startResize = useCallback((edge: TopEdge, event: { stopPropagation?: () => void; preventDefault?: () => void }) => {
|
|
59
73
|
stopMouse(event);
|
|
60
|
-
void rendererHost.
|
|
74
|
+
void rendererHost.startWindowResize?.(edge);
|
|
61
75
|
}, [rendererHost]);
|
|
62
76
|
|
|
77
|
+
if (maximized) return null;
|
|
63
78
|
return (
|
|
64
79
|
<Box
|
|
65
80
|
flexDirection="row"
|
|
66
|
-
|
|
67
|
-
flexShrink={0}
|
|
68
|
-
width={`${WINDOWS_CONTROL_GROUP_WIDTH_PX}px`}
|
|
69
|
-
data-gloom-role="window-controls"
|
|
70
|
-
data-window-kind={windowKind}
|
|
71
|
-
aria-hidden={false}
|
|
81
|
+
data-gloom-role="window-top-edge"
|
|
72
82
|
style={{
|
|
73
83
|
position: "fixed",
|
|
74
84
|
top: 0,
|
|
85
|
+
left: 0,
|
|
75
86
|
right: 0,
|
|
76
|
-
|
|
77
|
-
//
|
|
78
|
-
|
|
79
|
-
zIndex: 1000,
|
|
80
|
-
backgroundColor: "inherit",
|
|
87
|
+
height: `${TOP_EDGE_HEIGHT_PX}px`,
|
|
88
|
+
// Over the buttons too: a native frame's top edge runs above them.
|
|
89
|
+
zIndex: 1001,
|
|
81
90
|
}}
|
|
82
91
|
>
|
|
83
|
-
{
|
|
92
|
+
{TOP_EDGES.map(({ edge, cursor, width }) => (
|
|
84
93
|
<Box
|
|
85
|
-
key={
|
|
86
|
-
alignItems="center"
|
|
87
|
-
justifyContent="center"
|
|
88
|
-
flexShrink={0}
|
|
89
|
-
width={`${WINDOWS_CONTROL_SIZE_PX}px`}
|
|
94
|
+
key={edge}
|
|
90
95
|
height="100%"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
>
|
|
99
|
-
<WindowControlIcon action={control.action} />
|
|
100
|
-
</Box>
|
|
96
|
+
flexGrow={width ? 0 : 1}
|
|
97
|
+
flexShrink={0}
|
|
98
|
+
width={width ? `${width}px` : undefined}
|
|
99
|
+
data-window-edge={edge}
|
|
100
|
+
style={{ cursor }}
|
|
101
|
+
onMouseDown={(event: { stopPropagation?: () => void; preventDefault?: () => void }) => startResize(edge, event)}
|
|
102
|
+
/>
|
|
101
103
|
))}
|
|
102
104
|
</Box>
|
|
103
105
|
);
|
|
104
106
|
}
|
|
107
|
+
|
|
108
|
+
interface WindowControlsProps {
|
|
109
|
+
windowKind?: "main" | "detached";
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function WindowControls({ windowKind = "main" }: WindowControlsProps) {
|
|
113
|
+
useAppLanguage();
|
|
114
|
+
const rendererHost = useRendererHost();
|
|
115
|
+
|
|
116
|
+
const controlWindow = useCallback((action: WindowControlAction, event: { stopPropagation?: () => void; preventDefault?: () => void }) => {
|
|
117
|
+
stopMouse(event);
|
|
118
|
+
void rendererHost.controlWindow?.(action);
|
|
119
|
+
}, [rendererHost]);
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<>
|
|
123
|
+
<WindowTopEdge />
|
|
124
|
+
<Box
|
|
125
|
+
flexDirection="row"
|
|
126
|
+
alignItems="stretch"
|
|
127
|
+
flexShrink={0}
|
|
128
|
+
width={`${WINDOWS_CONTROL_GROUP_WIDTH_PX}px`}
|
|
129
|
+
data-gloom-role="window-controls"
|
|
130
|
+
data-window-kind={windowKind}
|
|
131
|
+
aria-hidden={false}
|
|
132
|
+
style={{
|
|
133
|
+
position: "fixed",
|
|
134
|
+
top: 0,
|
|
135
|
+
right: 0,
|
|
136
|
+
// A popped-out window's title bar is its pane header, which ends in a
|
|
137
|
+
// 1px rule; the buttons stop above it so the rule runs the full width.
|
|
138
|
+
height: `${WINDOWS_CONTROL_SIZE_PX - (windowKind === "detached" ? 1 : 0)}px`,
|
|
139
|
+
zIndex: 1000,
|
|
140
|
+
backgroundColor: "inherit",
|
|
141
|
+
}}
|
|
142
|
+
>
|
|
143
|
+
{WINDOWS_CONTROLS.map((control) => (
|
|
144
|
+
<Box
|
|
145
|
+
key={control.action}
|
|
146
|
+
alignItems="center"
|
|
147
|
+
justifyContent="center"
|
|
148
|
+
flexShrink={0}
|
|
149
|
+
width={`${WINDOWS_CONTROL_SIZE_PX}px`}
|
|
150
|
+
height="100%"
|
|
151
|
+
data-gloom-role="window-control"
|
|
152
|
+
data-window-control-action={control.action}
|
|
153
|
+
data-gloom-interactive="true"
|
|
154
|
+
role="button"
|
|
155
|
+
aria-label={t(control.labelKey)}
|
|
156
|
+
title={t(control.labelKey)}
|
|
157
|
+
onMouseDown={(event: { stopPropagation?: () => void; preventDefault?: () => void }) => controlWindow(control.action, event)}
|
|
158
|
+
>
|
|
159
|
+
<WindowControlIcon action={control.action} />
|
|
160
|
+
</Box>
|
|
161
|
+
))}
|
|
162
|
+
</Box>
|
|
163
|
+
</>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
@@ -30,3 +30,23 @@ function subscribeWindowFullscreen(listener: () => void): () => void {
|
|
|
30
30
|
export function useWindowFullscreen(): boolean {
|
|
31
31
|
return useSyncExternalStore(subscribeWindowFullscreen, isWindowFullscreen, () => false);
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
let windowMaximized = false;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Whether the window hosting this view is maximized. On Windows it then has
|
|
38
|
+
* no edge to resize from, and its buttons run to the screen's top edge.
|
|
39
|
+
*/
|
|
40
|
+
export function setWindowMaximized(next: boolean): void {
|
|
41
|
+
if (windowMaximized === next) return;
|
|
42
|
+
windowMaximized = next;
|
|
43
|
+
for (const listener of [...listeners]) listener();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function isWindowMaximized(): boolean {
|
|
47
|
+
return windowMaximized;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function useWindowMaximized(): boolean {
|
|
51
|
+
return useSyncExternalStore(subscribeWindowFullscreen, isWindowMaximized, () => false);
|
|
52
|
+
}
|
|
@@ -27,6 +27,7 @@ export const KEEP_FREE_KEY = "f";
|
|
|
27
27
|
export const CONNECT_BROKER_KEY = "b";
|
|
28
28
|
export const BROWSER_SIGN_IN_KEY = "b";
|
|
29
29
|
export const SKIP_DESKS_KEY = "s";
|
|
30
|
+
export const SKIP_PORTFOLIO_KEY = "s";
|
|
30
31
|
|
|
31
32
|
/** Digits jump straight to a section the header would let you click. */
|
|
32
33
|
const SECTION_DIGITS: Record<string, OnboardingSectionId> = { "1": "portfolio", "2": "cloud", "3": "pro" };
|
|
@@ -54,7 +55,7 @@ export function keyReachesPastOnboardingModal(event: KeyEventLike, keybindings:
|
|
|
54
55
|
export function useOnboardingKeyboard({
|
|
55
56
|
stage, progress, account, helpFocused, editingField, isBrokerCommitting, planAccess, continueFree, finish,
|
|
56
57
|
sectionAvailability, goToSection, portfolioSub, positions, setEditingField, positionCount,
|
|
57
|
-
continueFromPositions, openBrokerConnect, movePositionCursor, removePositionAtCursor, submitBrokerField,
|
|
58
|
+
continueFromPositions, skipPositions, openBrokerConnect, movePositionCursor, removePositionAtCursor, submitBrokerField,
|
|
58
59
|
submitAccountField, backPortfolio, continuePortfolio, setPortfolioOptionIdx, activeBrokerFields,
|
|
59
60
|
brokerFieldIdx, setBrokerSelectIdx, brokerChoices, openBrokerGuide, chosenDesks, finishDesks,
|
|
60
61
|
setDeskCursor, deskCursor, setChosenDesks, continueAccount, skipSetup, primaryUpgradeAction,
|
|
@@ -76,6 +77,7 @@ export function useOnboardingKeyboard({
|
|
|
76
77
|
setEditingField: Dispatch<SetStateAction<boolean>>;
|
|
77
78
|
positionCount: number;
|
|
78
79
|
continueFromPositions: () => void;
|
|
80
|
+
skipPositions: () => void;
|
|
79
81
|
openBrokerConnect: () => void;
|
|
80
82
|
movePositionCursor: (delta: number) => void;
|
|
81
83
|
removePositionAtCursor: () => void;
|
|
@@ -165,6 +167,8 @@ export function useOnboardingKeyboard({
|
|
|
165
167
|
positions.focusField(tab && event.shift ? POSITION_FIELDS.length - 1 : 0);
|
|
166
168
|
} else if (letter(CONNECT_BROKER_KEY) && positionCount > 0) {
|
|
167
169
|
openBrokerConnect();
|
|
170
|
+
} else if (letter(SKIP_PORTFOLIO_KEY) && positionCount === 0) {
|
|
171
|
+
skipPositions();
|
|
168
172
|
} else if (!chord && (name === "up" || name === "k")) {
|
|
169
173
|
movePositionCursor(-1);
|
|
170
174
|
} else if (!chord && (name === "down" || name === "j")) {
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
CONNECT_BROKER_KEY,
|
|
50
50
|
BROWSER_SIGN_IN_KEY,
|
|
51
51
|
SKIP_DESKS_KEY,
|
|
52
|
+
SKIP_PORTFOLIO_KEY,
|
|
52
53
|
} from "./onboarding-keyboard";
|
|
53
54
|
import { useOnboardingBrokerFields, useOnboardingBrokerForm } from "./use-onboarding-broker-form";
|
|
54
55
|
import { useOnboardingProgress, useOnboardingWorkspace, useOnboardingCompletion } from "./use-onboarding-progress";
|
|
@@ -155,7 +156,7 @@ function useOnboardingWizard({ pluginRegistry, importBrokerPositions, onComplete
|
|
|
155
156
|
}, [portfolioSub, stage]);
|
|
156
157
|
const {
|
|
157
158
|
chosenDesks, setChosenDesks, deskCursor, setDeskCursor, buildingDesks, continueFromPositions,
|
|
158
|
-
finishDesks, handleBrokerSynced,
|
|
159
|
+
skipPositions, finishDesks, handleBrokerSynced,
|
|
159
160
|
} = useOnboardingWorkspace({
|
|
160
161
|
stateRef, pluginRegistry, dispatch, positions, setEditingField, saveProgressInBackground,
|
|
161
162
|
setPersistenceError, finishingRef, brokerOptions, selectedBrokerId, setPortfolioSub,
|
|
@@ -306,7 +307,7 @@ function useOnboardingWizard({ pluginRegistry, importBrokerPositions, onComplete
|
|
|
306
307
|
useOnboardingKeyboard({
|
|
307
308
|
stage, progress, account, helpFocused, editingField, isBrokerCommitting, planAccess, continueFree,
|
|
308
309
|
finish, sectionAvailability, goToSection, portfolioSub, positions, setEditingField, positionCount,
|
|
309
|
-
continueFromPositions, openBrokerConnect, movePositionCursor, removePositionAtCursor, submitBrokerField,
|
|
310
|
+
continueFromPositions, skipPositions, openBrokerConnect, movePositionCursor, removePositionAtCursor, submitBrokerField,
|
|
310
311
|
submitAccountField, backPortfolio, continuePortfolio, setPortfolioOptionIdx, activeBrokerFields,
|
|
311
312
|
brokerFieldIdx, setBrokerSelectIdx, brokerChoices, openBrokerGuide, chosenDesks, finishDesks,
|
|
312
313
|
setDeskCursor, deskCursor, setChosenDesks, continueAccount, skipSetup, primaryUpgradeAction,
|
|
@@ -320,7 +321,7 @@ function useOnboardingWizard({ pluginRegistry, importBrokerPositions, onComplete
|
|
|
320
321
|
inputRef, editingField, selectedPositionSymbol, brokerChoices, portfolioOptionIdx, setPortfolioOptionIdx,
|
|
321
322
|
chooseBroker, activeBrokerFields, brokerFieldIdx, brokerSelectIdx, setBrokerSelectIdx, brokerValues,
|
|
322
323
|
setBrokerFieldValue, isBrokerSyncing, brokerSyncError, persistenceError, positionCount,
|
|
323
|
-
openBrokerConnect, continueFromPositions, backPortfolio, continuePortfolio, chosenDesks, deskCursor,
|
|
324
|
+
openBrokerConnect, continueFromPositions, skipPositions, backPortfolio, continuePortfolio, chosenDesks, deskCursor,
|
|
324
325
|
setDeskCursor, setChosenDesks, buildingDesks, finishDesks, account, viewportWidth, viewportHeight, continueAccount,
|
|
325
326
|
offer, planAccess, pricing, billingInterval, setBillingInterval, continueFree, primaryUpgradeAction,
|
|
326
327
|
goBack, rerun,
|
|
@@ -335,7 +336,7 @@ export function OnboardingWizard(props: OnboardingWizardProps) {
|
|
|
335
336
|
inputRef, editingField, selectedPositionSymbol, brokerChoices, portfolioOptionIdx, setPortfolioOptionIdx,
|
|
336
337
|
chooseBroker, activeBrokerFields, brokerFieldIdx, brokerSelectIdx, setBrokerSelectIdx, brokerValues,
|
|
337
338
|
setBrokerFieldValue, isBrokerSyncing, brokerSyncError, persistenceError, positionCount,
|
|
338
|
-
openBrokerConnect, continueFromPositions, backPortfolio, continuePortfolio, chosenDesks, deskCursor,
|
|
339
|
+
openBrokerConnect, continueFromPositions, skipPositions, backPortfolio, continuePortfolio, chosenDesks, deskCursor,
|
|
339
340
|
setDeskCursor, setChosenDesks, buildingDesks, finishDesks, account, viewportWidth, viewportHeight, continueAccount,
|
|
340
341
|
offer, planAccess, pricing, billingInterval, setBillingInterval, continueFree, primaryUpgradeAction,
|
|
341
342
|
goBack, rerun,
|
|
@@ -462,6 +463,16 @@ export function OnboardingWizard(props: OnboardingWizardProps) {
|
|
|
462
463
|
{brokerOptions.length > 0 && positionCount > 0 ? (
|
|
463
464
|
<OnboardingButton label="Connect a broker" variant="ghost" shortcut={CONNECT_BROKER_KEY} onPress={openBrokerConnect} />
|
|
464
465
|
) : null}
|
|
466
|
+
{/* Holding nothing yet, the step can be left as the Desks step can. */}
|
|
467
|
+
{positionCount === 0 ? (
|
|
468
|
+
<OnboardingButton
|
|
469
|
+
label="Skip"
|
|
470
|
+
variant="ghost"
|
|
471
|
+
shortcut={SKIP_PORTFOLIO_KEY}
|
|
472
|
+
disabled={positions.submitting}
|
|
473
|
+
onPress={skipPositions}
|
|
474
|
+
/>
|
|
475
|
+
) : null}
|
|
465
476
|
<OnboardingButton
|
|
466
477
|
label="Continue"
|
|
467
478
|
variant="primary"
|
|
@@ -61,14 +61,17 @@ function PreviewLine({ preview, error }: Pick<OnboardingPositionsState, "preview
|
|
|
61
61
|
const headline = getRegularSessionDisplay(preview.quote);
|
|
62
62
|
const price = headline?.price;
|
|
63
63
|
const change = headline?.changePercent;
|
|
64
|
+
// Only the name gives way to a narrow row, clipped on its right: the symbol, price and move keep every cell.
|
|
64
65
|
return (
|
|
65
66
|
<Box flexDirection="row" alignItems="center" minWidth={0} overflow="hidden">
|
|
66
|
-
<Text fg={colors.text} attributes={TextAttributes.BOLD}>{preview.symbol}</Text>
|
|
67
|
-
{preview.name ?
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
<Box flexShrink={0}><Text fg={colors.text} attributes={TextAttributes.BOLD}>{preview.symbol}</Text></Box>
|
|
68
|
+
{preview.name ? (
|
|
69
|
+
<Box flexShrink={1} minWidth={0} overflow="hidden" paddingLeft={2}><Text fg={colors.textDim}>{preview.name}</Text></Box>
|
|
70
|
+
) : null}
|
|
71
|
+
{price != null ? <Box flexShrink={0} paddingLeft={2}><Text fg={colors.text}>{formatMarketPrice(price, { maxWidth: 12 })}</Text></Box> : null}
|
|
72
|
+
{change != null ? <Box flexShrink={0} paddingLeft={1}><Text fg={shownPriceColor(change, 2, colors)}>{formatPercentRaw(change)}</Text></Box> : null}
|
|
70
73
|
{price != null && delay != null ? <Box flexShrink={0} paddingLeft={1}><DelayedMark minutes={delay} /></Box> : null}
|
|
71
|
-
{preview.duplicate ? <Text fg={colors.textMuted}>{t(" already added")}</Text> : null}
|
|
74
|
+
{preview.duplicate ? <Box flexShrink={0}><Text fg={colors.textMuted}>{t(" already added")}</Text></Box> : null}
|
|
72
75
|
</Box>
|
|
73
76
|
);
|
|
74
77
|
}
|