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
|
@@ -13,6 +13,7 @@ import type { useOnboardingPositions } from "./wizard-positions";
|
|
|
13
13
|
import {
|
|
14
14
|
applyFirstRunLayout,
|
|
15
15
|
buildFirstRunLayout,
|
|
16
|
+
FIRST_RUN_WATCHLIST,
|
|
16
17
|
onboardingDeskLayoutId,
|
|
17
18
|
planFirstRunWatchlist,
|
|
18
19
|
setupDeskPicks,
|
|
@@ -202,6 +203,24 @@ export function useOnboardingWorkspace({
|
|
|
202
203
|
});
|
|
203
204
|
}, [positions, saveProgressInBackground]);
|
|
204
205
|
|
|
206
|
+
/**
|
|
207
|
+
* Leaves "What do you hold?" holding nothing, as the Desks step can be left
|
|
208
|
+
* picking nothing: the workspace is built around the first name on the
|
|
209
|
+
* first-run watchlist, and holdings can be added once it is open.
|
|
210
|
+
*/
|
|
211
|
+
const skipPositions = useCallback(() => {
|
|
212
|
+
if (positions.positions.length > 0) return;
|
|
213
|
+
setEditingField(false);
|
|
214
|
+
saveProgressInBackground({
|
|
215
|
+
stage: "desks",
|
|
216
|
+
path: "manual",
|
|
217
|
+
portfolioId: positions.portfolioId,
|
|
218
|
+
tickerSymbol: FIRST_RUN_WATCHLIST[0]!.ticker,
|
|
219
|
+
positionsImported: 0,
|
|
220
|
+
brokerName: undefined,
|
|
221
|
+
});
|
|
222
|
+
}, [positions, saveProgressInBackground]);
|
|
223
|
+
|
|
205
224
|
/**
|
|
206
225
|
* Leaves "What do you trade most?": builds the workspace with the picked desks as
|
|
207
226
|
* tabs (none when skipped, which is today's workspace) and moves on.
|
|
@@ -261,7 +280,7 @@ export function useOnboardingWorkspace({
|
|
|
261
280
|
|
|
262
281
|
return {
|
|
263
282
|
chosenDesks, setChosenDesks, deskCursor, setDeskCursor, buildingDesks, continueFromPositions,
|
|
264
|
-
finishDesks, handleBrokerSynced,
|
|
283
|
+
skipPositions, finishDesks, handleBrokerSynced,
|
|
265
284
|
};
|
|
266
285
|
}
|
|
267
286
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
1
|
+
import { memo, useMemo } from "react";
|
|
2
2
|
import {
|
|
3
3
|
Box,
|
|
4
4
|
ChartSurface,
|
|
@@ -7,8 +7,10 @@ import {
|
|
|
7
7
|
useUiCapabilities,
|
|
8
8
|
} from "../../ui";
|
|
9
9
|
import { useThemeColors } from "../../theme/theme-context";
|
|
10
|
+
import { markPure } from "../../ui/same-props";
|
|
10
11
|
import type { PricePoint } from "../../types/financials";
|
|
11
12
|
import { resolveNativeBitmapSize, shouldRenderNativeBitmap } from "../chart/native/bitmap-support";
|
|
13
|
+
import { useNativeBitmapMetrics } from "../chart/native/use-bitmap-metrics";
|
|
12
14
|
import { renderSparklineBitmap } from "./bitmap";
|
|
13
15
|
import {
|
|
14
16
|
buildSamples,
|
|
@@ -90,10 +92,14 @@ function TerminalPriceSparkline({
|
|
|
90
92
|
}) {
|
|
91
93
|
const { nativeCharts, cellWidthPx = 8, cellHeightPx = 18, pixelRatio = 1 } = useUiCapabilities();
|
|
92
94
|
const nativeRenderer = useNativeRenderer();
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
95
|
+
// Subscribed, not read off the renderer: the sparkline skips the renders a
|
|
96
|
+
// quote gives its row, so a resize or a late pixel size has to reach it.
|
|
97
|
+
const {
|
|
98
|
+
resolution: rendererResolution,
|
|
99
|
+
capabilities: rendererCapabilities,
|
|
100
|
+
terminalWidth: rendererTerminalWidth,
|
|
101
|
+
terminalHeight: rendererTerminalHeight,
|
|
102
|
+
} = useNativeBitmapMetrics(nativeRenderer);
|
|
97
103
|
const bitmap = useMemo(() => {
|
|
98
104
|
if (values.length < 2 || !shouldRenderNativeBitmap(nativeRenderer, nativeCharts === true)) return null;
|
|
99
105
|
const bitmapSize = resolveNativeBitmapSize({
|
|
@@ -135,7 +141,9 @@ function TerminalPriceSparkline({
|
|
|
135
141
|
);
|
|
136
142
|
}
|
|
137
143
|
|
|
138
|
-
export
|
|
144
|
+
export const PriceSparkline = markPure(memo(PriceSparklineView));
|
|
145
|
+
|
|
146
|
+
function PriceSparklineView({
|
|
139
147
|
priceHistory,
|
|
140
148
|
width,
|
|
141
149
|
trend,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useEffect, useRef
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
2
|
import type { TickerFinancials } from "../types/financials";
|
|
3
3
|
import { getActiveQuoteDisplay } from "../market-data/market/status";
|
|
4
|
+
import { useDataFrameWake } from "../market-data/frame-wake";
|
|
4
5
|
|
|
5
6
|
export type QuoteFlashDirection = "up" | "down" | "flat";
|
|
6
7
|
|
|
@@ -99,47 +100,50 @@ function sameFlashes(left: Map<string, QuoteFlashDirection>, right: Map<string,
|
|
|
99
100
|
|
|
100
101
|
const EMPTY_FLASHES = new Map<string, QuoteFlashDirection>();
|
|
101
102
|
|
|
103
|
+
function sameDeps(left: readonly unknown[] | null, right: readonly unknown[]): boolean {
|
|
104
|
+
return !!left && left.length === right.length && left.every((value, index) => Object.is(value, right[index]));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The flashes to show. New prices are observed while rendering, so a price and
|
|
109
|
+
* its flash reach the screen in the same commit, and a flash ends in the first
|
|
110
|
+
* market data frame after it is due, with whatever quotes that frame brings:
|
|
111
|
+
* neither costs a commit (in the terminal, a full redraw) of its own.
|
|
112
|
+
*/
|
|
102
113
|
function useFlashTracker(
|
|
103
114
|
collect: (tracker: QuoteFlashTracker, now: number) => void,
|
|
104
115
|
enabled: boolean,
|
|
105
116
|
deps: readonly unknown[],
|
|
106
117
|
): Map<string, QuoteFlashDirection> {
|
|
107
|
-
const [flashes, setFlashes] = useState<Map<string, QuoteFlashDirection>>(EMPTY_FLASHES);
|
|
108
118
|
const trackerRef = useRef<QuoteFlashTracker | null>(null);
|
|
109
119
|
trackerRef.current ??= new QuoteFlashTracker();
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
120
|
+
const tracker = trackerRef.current;
|
|
121
|
+
const observedRef = useRef<readonly unknown[] | null>(null);
|
|
122
|
+
const shownRef = useRef<Map<string, QuoteFlashDirection>>(EMPTY_FLASHES);
|
|
123
|
+
const clock = useDataFrameWake();
|
|
124
|
+
|
|
125
|
+
const now = clock.now();
|
|
126
|
+
// Once per set of inputs: a render for any other reason (or a repeated one) observes nothing.
|
|
127
|
+
if (!sameDeps(observedRef.current, deps)) {
|
|
128
|
+
observedRef.current = deps;
|
|
129
|
+
collect(tracker, now);
|
|
130
|
+
}
|
|
131
|
+
let flashes = EMPTY_FLASHES;
|
|
132
|
+
if (!enabled) {
|
|
133
|
+
tracker.clear();
|
|
134
|
+
} else {
|
|
115
135
|
tracker.prune(now);
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (nextAt != null) {
|
|
122
|
-
timeoutRef.current = setTimeout(publish, Math.max(0, nextAt - Date.now()));
|
|
123
|
-
}
|
|
124
|
-
};
|
|
136
|
+
const active = tracker.active(now);
|
|
137
|
+
flashes = sameFlashes(shownRef.current, active) ? shownRef.current : active.size === 0 ? EMPTY_FLASHES : active;
|
|
138
|
+
}
|
|
139
|
+
shownRef.current = flashes;
|
|
140
|
+
const endsAt = enabled ? tracker.nextChangeAt(now) : null;
|
|
125
141
|
|
|
142
|
+
// Booked after every render that still shows a flash.
|
|
126
143
|
useEffect(() => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (!enabled) {
|
|
131
|
-
tracker.clear();
|
|
132
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
133
|
-
timeoutRef.current = null;
|
|
134
|
-
setFlashes(EMPTY_FLASHES);
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
publish();
|
|
138
|
-
}, [enabled, ...deps]);
|
|
139
|
-
|
|
140
|
-
useEffect(() => () => {
|
|
141
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
142
|
-
}, []);
|
|
144
|
+
if (endsAt != null) clock.wakeAt(endsAt);
|
|
145
|
+
else clock.cancel();
|
|
146
|
+
});
|
|
143
147
|
|
|
144
148
|
return flashes;
|
|
145
149
|
}
|
|
@@ -11,6 +11,8 @@ import { usePaneLinkMenuEntry } from "../../ui/external-link";
|
|
|
11
11
|
|
|
12
12
|
export interface TickerBadgeProps {
|
|
13
13
|
symbol: string;
|
|
14
|
+
/** The listing the chip stands for when it is not the symbol as written (`2330` is `2330:TWSE`): what it resolves, prices and opens. */
|
|
15
|
+
listing?: string;
|
|
14
16
|
status: TickerBadgeStatus;
|
|
15
17
|
quote: Quote | null;
|
|
16
18
|
liveQuote?: boolean;
|
|
@@ -37,6 +39,7 @@ const NATIVE_PRICE_OVER_RESTING_TEXT = { position: "absolute", inset: 0, overflo
|
|
|
37
39
|
|
|
38
40
|
export function TickerBadge({
|
|
39
41
|
symbol,
|
|
42
|
+
listing,
|
|
40
43
|
status,
|
|
41
44
|
quote,
|
|
42
45
|
liveQuote = true,
|
|
@@ -49,8 +52,9 @@ export function TickerBadge({
|
|
|
49
52
|
}: TickerBadgeProps) {
|
|
50
53
|
const registry = getSharedRegistry();
|
|
51
54
|
const { nativeContextMenu, nativePaneChrome } = useUiCapabilities();
|
|
52
|
-
const
|
|
53
|
-
const
|
|
55
|
+
const key = listing ?? symbol;
|
|
56
|
+
const ticker = typeof registry?.getTicker === "function" ? registry.getTicker(key) : null;
|
|
57
|
+
const financials = typeof registry?.getData === "function" ? registry.getData(key) : null;
|
|
54
58
|
const openTickerContextMenu = useTickerContextMenu({
|
|
55
59
|
ticker,
|
|
56
60
|
financials,
|
|
@@ -65,7 +69,7 @@ export function TickerBadge({
|
|
|
65
69
|
const { fg: color, bg: backgroundColor } = tickerBadgeColors(tone, hovered);
|
|
66
70
|
// An ambiguous symbol is worth opening: that is how the listing gets picked.
|
|
67
71
|
const interactive = status !== "loading";
|
|
68
|
-
usePaneLinkMenuEntry(interactive ? `ticker:${
|
|
72
|
+
usePaneLinkMenuEntry(interactive ? `ticker:${key}` : null, tf("Open {ticker}", { ticker: symbol }), () => onOpen(key));
|
|
69
73
|
|
|
70
74
|
return (
|
|
71
75
|
<Box paddingRight={trailingGap ? 1 : 0} flexShrink={0} justifyContent={nativePaneChrome ? "center" : undefined}>
|
|
@@ -95,7 +99,7 @@ export function TickerBadge({
|
|
|
95
99
|
event.stopPropagation?.();
|
|
96
100
|
event.preventDefault?.();
|
|
97
101
|
if (!interactive) return;
|
|
98
|
-
onOpen(
|
|
102
|
+
onOpen(key);
|
|
99
103
|
}}
|
|
100
104
|
onContextMenu={(event: any) => {
|
|
101
105
|
void openTickerContextMenu(event);
|
|
@@ -28,6 +28,16 @@ export interface TickerBadgeListProps {
|
|
|
28
28
|
* column of looked-up symbols can mix chips and bare words.
|
|
29
29
|
*/
|
|
30
30
|
listed?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The listing a symbol stands for when its own spelling names none: a
|
|
33
|
+
* number-only Asian listing (`2330`) reads as money, so the source's venue
|
|
34
|
+
* makes it `2330:TWSE`. The chip keeps the symbol as written and looks up,
|
|
35
|
+
* prices and opens the listing, as it does for any other ticker. `null`
|
|
36
|
+
* says the source names no listing the app can read: that symbol prints as
|
|
37
|
+
* plain text, as one whose lookup fails does, never as a chip of another
|
|
38
|
+
* look beside resolved ones. Symbols not listed here stand for themselves.
|
|
39
|
+
*/
|
|
40
|
+
listings?: Readonly<Record<string, string | null>>;
|
|
31
41
|
/** Opens a badge; by default the symbol is resolved and opened as a ticker link would be. */
|
|
32
42
|
onOpen?: (symbol: string) => void;
|
|
33
43
|
}
|
|
@@ -44,6 +54,7 @@ export function TickerBadgeList({
|
|
|
44
54
|
fallbackColor = colors.textBright,
|
|
45
55
|
liveQuote = true,
|
|
46
56
|
listed = false,
|
|
57
|
+
listings,
|
|
47
58
|
onOpen,
|
|
48
59
|
}: TickerBadgeListProps) {
|
|
49
60
|
const [hoveredSymbol, setHoveredSymbol] = useState<string | null>(null);
|
|
@@ -61,9 +72,11 @@ export function TickerBadgeList({
|
|
|
61
72
|
)),
|
|
62
73
|
[symbols],
|
|
63
74
|
);
|
|
75
|
+
/** What a symbol is looked up and opened by: its listing, else itself. */
|
|
76
|
+
const keyOf = (symbol: string): string => listings?.[symbol] ?? symbol;
|
|
64
77
|
const tickerTexts = useMemo(
|
|
65
|
-
() => (listed ? [] : named.map((symbol) => `$${symbol}`)),
|
|
66
|
-
[listed, named],
|
|
78
|
+
() => (listed ? [] : named.filter((symbol) => listings?.[symbol] !== null).map((symbol) => `$${listings?.[symbol] ?? symbol}`)),
|
|
79
|
+
[listed, listings, named],
|
|
67
80
|
);
|
|
68
81
|
/**
|
|
69
82
|
* Quotes are only worth fetching where they can be read. A column with no
|
|
@@ -99,23 +112,25 @@ export function TickerBadgeList({
|
|
|
99
112
|
return named.map((symbol) => {
|
|
100
113
|
const base = displayWidth(symbol);
|
|
101
114
|
const budget = base + Math.max(0, remaining);
|
|
115
|
+
const entry = catalog[listings?.[symbol] ?? symbol];
|
|
102
116
|
const chosen = getTickerBadgeText({
|
|
103
117
|
symbol,
|
|
104
|
-
status: badgeStatus(
|
|
105
|
-
quote:
|
|
118
|
+
status: badgeStatus(entry),
|
|
119
|
+
quote: entry?.quote ?? null,
|
|
106
120
|
liveQuote: liveQuotes,
|
|
107
121
|
maxTextWidth: budget,
|
|
108
122
|
});
|
|
109
123
|
remaining -= displayWidth(chosen) - base;
|
|
110
124
|
return budget;
|
|
111
125
|
});
|
|
112
|
-
}, [catalog, liveQuotes, named, slack]);
|
|
126
|
+
}, [catalog, listings, liveQuotes, named, slack]);
|
|
113
127
|
|
|
114
128
|
return (
|
|
115
129
|
<Box flexDirection="row" width={width} height={1} overflow="hidden">
|
|
116
130
|
{named.map((symbol, index) => {
|
|
117
|
-
const
|
|
118
|
-
|
|
131
|
+
const key = keyOf(symbol);
|
|
132
|
+
const entry = catalog[key];
|
|
133
|
+
if (entry?.status === "missing" || (!listed && listings?.[symbol] === null)) {
|
|
119
134
|
return (
|
|
120
135
|
<Box key={symbol} paddingRight={1} flexShrink={0}>
|
|
121
136
|
<Text fg={fallbackColor} attributes={TextAttributes.BOLD}>{symbol}</Text>
|
|
@@ -127,6 +142,7 @@ export function TickerBadgeList({
|
|
|
127
142
|
<TickerBadge
|
|
128
143
|
key={symbol}
|
|
129
144
|
symbol={symbol}
|
|
145
|
+
listing={listings?.[symbol] ?? undefined}
|
|
130
146
|
status={badgeStatus(entry)}
|
|
131
147
|
quote={liveQuotes ? entry?.quote ?? null : null}
|
|
132
148
|
liveQuote={liveQuotes}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { memo, type CSSProperties, type ReactNode } from "react";
|
|
2
2
|
import { Box, Text, useUiCapabilities } from "../../ui";
|
|
3
|
+
import { markPure } from "../../ui/same-props";
|
|
3
4
|
import { hoverBg } from "../../theme/colors";
|
|
4
5
|
import { useThemeColors } from "../../theme/theme-context";
|
|
5
6
|
import { displayWidth, padTo, truncateToDisplayWidth } from "../../utils/format";
|
|
6
7
|
import { ExternalLinkText, usePaneLinkMenuEntry } from "./external-link";
|
|
8
|
+
import { useAppLanguage } from "../../i18n/react";
|
|
7
9
|
|
|
8
10
|
/** One column of a ColumnGrid. */
|
|
9
11
|
export interface ColumnGridColumn {
|
|
@@ -209,7 +211,11 @@ export interface ColumnGridPairProps {
|
|
|
209
211
|
* the value right-aligned in the rest and cut from its end when it is too
|
|
210
212
|
* long, and its muted detail after it. The detail gives way before the value.
|
|
211
213
|
*/
|
|
212
|
-
export
|
|
214
|
+
export const ColumnGridPair = markPure(memo(ColumnGridPairView));
|
|
215
|
+
|
|
216
|
+
function ColumnGridPairView({ label, labelWidth, width, value, valueColor, detail, url }: ColumnGridPairProps) {
|
|
217
|
+
// A link's menu entry is worded in the app's language.
|
|
218
|
+
useAppLanguage();
|
|
213
219
|
const colors = useThemeColors();
|
|
214
220
|
const { nativePaneChrome } = useUiCapabilities();
|
|
215
221
|
const color = valueColor ?? colors.text;
|
|
@@ -258,11 +258,14 @@ export function resolveDataTableVisibleWindow<T>({
|
|
|
258
258
|
scrollTop,
|
|
259
259
|
virtualize,
|
|
260
260
|
}: DataTableVisibleWindowOptions<T>): DataTableVisibleWindow<T> {
|
|
261
|
+
// A viewport the renderer has not laid out yet reads 0 (a laid-out one is at
|
|
262
|
+
// least a row): a render before the first layout keeps the default window
|
|
263
|
+
// rather than drawing one row until the size change re-renders the table.
|
|
261
264
|
const viewportHeight = virtualize
|
|
262
265
|
? Math.max(
|
|
263
266
|
1,
|
|
264
267
|
Math.min(
|
|
265
|
-
measuredViewportHeight
|
|
268
|
+
measuredViewportHeight || Math.min(items.length, 16),
|
|
266
269
|
Math.max(1, Math.ceil(appViewportHeight)),
|
|
267
270
|
),
|
|
268
271
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useEffect, useId, useMemo, useRef, useState, type ReactNode } from "react";
|
|
1
|
+
import { memo, useCallback, useEffect, useId, useMemo, useRef, useState, type ReactNode } from "react";
|
|
2
2
|
import { usePaneMenuItems, usePaneTabStripKeys } from "../layout/pane/footer/registration";
|
|
3
3
|
import type { ContextMenuItem } from "../../types/context-menu";
|
|
4
4
|
import { useShortcut } from "../../react/input";
|
|
@@ -66,7 +66,10 @@ export interface TabsProps {
|
|
|
66
66
|
|
|
67
67
|
const WHEEL_DELTA_PER_CELL = 8;
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
/** A pane re-renders on each quote; its tab strip only when the tabs or their state change. */
|
|
70
|
+
export const Tabs = memo(TabsView);
|
|
71
|
+
|
|
72
|
+
function TabsView({
|
|
70
73
|
tabs: rawTabs,
|
|
71
74
|
activeValue,
|
|
72
75
|
onSelect,
|
|
@@ -232,7 +232,8 @@ export function resolveTickerForPane(state: AppState, paneId: string, seen = new
|
|
|
232
232
|
if (seen.has(paneId)) return null;
|
|
233
233
|
seen.add(paneId);
|
|
234
234
|
const instance = findPaneInstance(state.config.layout, paneId);
|
|
235
|
-
|
|
235
|
+
// A pane in another desktop window: the ticker that window shows in it ("" while it shows none).
|
|
236
|
+
if (!instance) return state.linkedTickers?.[paneId] || null;
|
|
236
237
|
const cursorSymbol = getPaneState(state, paneId).cursorSymbol;
|
|
237
238
|
if (typeof cursorSymbol === "string" && cursorSymbol.trim()) return cursorSymbol;
|
|
238
239
|
return resolveTickerFromBinding(state, instance.binding, seen);
|
|
@@ -563,18 +564,26 @@ export function focusPaneState(state: AppState, paneId: string): AppState {
|
|
|
563
564
|
};
|
|
564
565
|
}
|
|
565
566
|
|
|
567
|
+
/** Panes in another desktop window that panes here follow: their links are not orphaned. */
|
|
568
|
+
export function linkedSourceIds(state: Pick<AppState, "linkedTickers">): ReadonlySet<string> | undefined {
|
|
569
|
+
return state.linkedTickers ? new Set(Object.keys(state.linkedTickers)) : undefined;
|
|
570
|
+
}
|
|
571
|
+
|
|
566
572
|
export function withFocusedPane(
|
|
567
573
|
state: AppState,
|
|
568
574
|
config: AppConfig,
|
|
569
575
|
options: {
|
|
570
576
|
paneState?: Record<string, PaneRuntimeState>;
|
|
571
577
|
focusedPaneId?: string | null;
|
|
578
|
+
/** Follow sources in another window; `state`'s own by default. */
|
|
579
|
+
externalSourceIds?: ReadonlySet<string>;
|
|
572
580
|
} = {},
|
|
573
581
|
): AppState {
|
|
574
582
|
const normalizedLayout = normalizePaneLayout(config.layout, {
|
|
575
583
|
// Keep a follower alive on its last symbol when its source pane is gone.
|
|
576
584
|
resolveOrphanSymbol: (instanceId) => resolveTickerForPane(state, instanceId),
|
|
577
585
|
pinOrphan: pinFollowingPane,
|
|
586
|
+
externalSourceIds: options.externalSourceIds ?? linkedSourceIds(state),
|
|
578
587
|
});
|
|
579
588
|
const nextConfig = normalizedLayout === config.layout
|
|
580
589
|
? config
|
|
@@ -604,11 +613,17 @@ export function withFocusedPane(
|
|
|
604
613
|
}
|
|
605
614
|
|
|
606
615
|
export function hydrateDesktopSnapshot(state: AppState, snapshot: DesktopSharedStateSnapshot): AppState {
|
|
607
|
-
|
|
616
|
+
const linkedTickers = snapshot.linkedTickers && Object.keys(snapshot.linkedTickers).length > 0
|
|
617
|
+
? snapshot.linkedTickers
|
|
618
|
+
: undefined;
|
|
619
|
+
const next = withFocusedPane({
|
|
608
620
|
...state,
|
|
609
621
|
paneState: snapshot.paneState,
|
|
610
622
|
brokerSyncErrors: snapshot.brokerSyncErrors ?? {},
|
|
611
623
|
focusedPaneId: snapshot.focusedPaneId,
|
|
612
624
|
statusBarVisible: snapshot.statusBarVisible,
|
|
613
|
-
|
|
625
|
+
// A follower whose source in another window just closed stays on the ticker it last had there.
|
|
626
|
+
linkedTickers: linkedTickers || state.linkedTickers ? { ...state.linkedTickers, ...linkedTickers } : undefined,
|
|
627
|
+
}, snapshot.config, { externalSourceIds: linkedSourceIds({ linkedTickers }) ?? new Set() });
|
|
628
|
+
return next.linkedTickers === linkedTickers ? next : { ...next, linkedTickers };
|
|
614
629
|
}
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
getPanelFocusTarget,
|
|
16
16
|
getTopFloatingPaneId,
|
|
17
17
|
hydrateDesktopSnapshot,
|
|
18
|
+
linkedSourceIds,
|
|
18
19
|
nextRecentCommands,
|
|
19
20
|
nextRecentTickers,
|
|
20
21
|
reconcilePaneState,
|
|
@@ -32,6 +33,7 @@ export {
|
|
|
32
33
|
getEffectiveThemeId,
|
|
33
34
|
getFocusedCollectionId,
|
|
34
35
|
getFocusedTickerSymbol,
|
|
36
|
+
linkedSourceIds,
|
|
35
37
|
resolveCollectionForPane,
|
|
36
38
|
resolveTickerForPane,
|
|
37
39
|
syncConfigActiveLayoutState,
|
|
@@ -81,6 +81,11 @@ export interface AppState {
|
|
|
81
81
|
focusedPaneId: string | null;
|
|
82
82
|
previousFocusedPaneId: string | null;
|
|
83
83
|
paneState: Record<string, PaneRuntimeState>;
|
|
84
|
+
/**
|
|
85
|
+
* The tickers of panes in another desktop window that panes here follow,
|
|
86
|
+
* by pane id. Set by the desktop process; absent everywhere else.
|
|
87
|
+
*/
|
|
88
|
+
linkedTickers?: Record<string, string>;
|
|
84
89
|
recentTickers: string[];
|
|
85
90
|
commandBarOpen: boolean;
|
|
86
91
|
commandBarQuery: string;
|
|
@@ -287,6 +287,8 @@ export function sanitizeLayout(
|
|
|
287
287
|
value: unknown,
|
|
288
288
|
fallback: LayoutConfig,
|
|
289
289
|
chartMigration: LegacyChartMigrationContext = {},
|
|
290
|
+
/** Panes on other tabs a pane here may follow: on another desktop window, a link may cross tabs. */
|
|
291
|
+
externalSourceIds?: ReadonlySet<string>,
|
|
290
292
|
): LayoutConfig {
|
|
291
293
|
if (!isLayoutConfig(value)) {
|
|
292
294
|
return cloneLayout(fallback);
|
|
@@ -312,6 +314,7 @@ export function sanitizeLayout(
|
|
|
312
314
|
const normalized = normalizePaneLayout(layout, {
|
|
313
315
|
defaultFollowSourceInstanceId: getDefaultFollowSourceInstanceId(layout),
|
|
314
316
|
resolveOrphanSymbol: () => null,
|
|
317
|
+
externalSourceIds,
|
|
315
318
|
});
|
|
316
319
|
return removeUnreachablePaneInstances(normalized);
|
|
317
320
|
}
|
|
@@ -58,7 +58,7 @@ export function normalizeLoadedConfig(
|
|
|
58
58
|
const defaults = createDefaultConfig(dataDir);
|
|
59
59
|
const migration = migrateSavedConfig(saved, dataDir, host);
|
|
60
60
|
const candidate = migration.config;
|
|
61
|
-
const directLayout = sanitizeLayout(candidate.layout, defaults.layout);
|
|
61
|
+
const directLayout = sanitizeLayout(candidate.layout, defaults.layout, {}, savedPaneIds(candidate.layouts));
|
|
62
62
|
const layouts = sanitizeSavedLayouts(candidate.layouts, directLayout);
|
|
63
63
|
const activeLayoutIndex = sanitizeActiveLayoutIndex(candidate.activeLayoutIndex, layouts.length);
|
|
64
64
|
const layout = cloneLayout(layouts[activeLayoutIndex]?.layout ?? directLayout);
|
|
@@ -139,7 +139,7 @@ export function normalizeLoadedConfig(
|
|
|
139
139
|
|
|
140
140
|
export function normalizeConfigForSave(config: AppConfig): AppConfig {
|
|
141
141
|
const defaults = createDefaultConfig(config.dataDir);
|
|
142
|
-
const directLayout = sanitizeLayout(config.layout, defaults.layout);
|
|
142
|
+
const directLayout = sanitizeLayout(config.layout, defaults.layout, {}, savedPaneIds(config.layouts));
|
|
143
143
|
const sanitizedLayouts = sanitizeSavedLayouts(config.layouts, directLayout);
|
|
144
144
|
const activeLayoutIndex = sanitizeActiveLayoutIndex(config.activeLayoutIndex, sanitizedLayouts.length || 1);
|
|
145
145
|
const layout = cloneLayout(sanitizedLayouts[activeLayoutIndex]?.layout ?? directLayout);
|
|
@@ -469,10 +469,44 @@ function sanitizeLayoutOrigin(value: unknown): LayoutOrigin | undefined {
|
|
|
469
469
|
const sanitizedLayouts = new WeakMap<object, LayoutConfig>();
|
|
470
470
|
const sanitizedPaneStates = new WeakMap<object, { layout: LayoutConfig; result: ReturnType<typeof sanitizeSavedPaneState> }>();
|
|
471
471
|
|
|
472
|
-
|
|
472
|
+
/** Every pane id on a saved tab: the panes a link on another tab may follow. */
|
|
473
|
+
function savedPaneIds(value: unknown): ReadonlySet<string> {
|
|
474
|
+
const ids = new Set<string>();
|
|
475
|
+
if (!Array.isArray(value)) return ids;
|
|
476
|
+
for (const entry of value) {
|
|
477
|
+
const instances = isRecord(entry) && isRecord(entry.layout) ? entry.layout.instances : null;
|
|
478
|
+
if (!Array.isArray(instances)) continue;
|
|
479
|
+
for (const instance of instances) {
|
|
480
|
+
if (isRecord(instance) && typeof instance.instanceId === "string") ids.add(instance.instanceId);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
return ids;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* The panes a layout's links reach on other tabs. Links stay within a tab,
|
|
488
|
+
* except where another desktop window shows the tab a pane was moved to;
|
|
489
|
+
* those are kept, and every other dangling link is cut as before.
|
|
490
|
+
*/
|
|
491
|
+
function crossTabSources(value: LayoutConfig, paneIds: ReadonlySet<string>): ReadonlySet<string> | undefined {
|
|
492
|
+
if (!Array.isArray(value.instances)) return undefined;
|
|
493
|
+
const own = new Set(value.instances.map((instance) => instance?.instanceId));
|
|
494
|
+
const sources = new Set<string>();
|
|
495
|
+
for (const instance of value.instances) {
|
|
496
|
+
const binding = instance?.binding;
|
|
497
|
+
if (binding?.kind !== "follow" || typeof binding.sourceInstanceId !== "string") continue;
|
|
498
|
+
if (!own.has(binding.sourceInstanceId) && paneIds.has(binding.sourceInstanceId)) sources.add(binding.sourceInstanceId);
|
|
499
|
+
}
|
|
500
|
+
return sources.size > 0 ? sources : undefined;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
function sanitizeSavedLayoutOnce(value: unknown, fallbackLayout: LayoutConfig, paneIds: ReadonlySet<string>): LayoutConfig {
|
|
473
504
|
// An invalid value sanitizes to a copy of the fallback, which is not a
|
|
474
505
|
// function of the value alone.
|
|
475
506
|
if (!isLayoutConfig(value)) return sanitizeLayout(value, fallbackLayout);
|
|
507
|
+
const external = crossTabSources(value, paneIds);
|
|
508
|
+
// A link to another tab depends on the other tabs too: those are not cached.
|
|
509
|
+
if (external) return sanitizeLayout(value, fallbackLayout, {}, external);
|
|
476
510
|
const cached = sanitizedLayouts.get(value);
|
|
477
511
|
if (cached) return cached;
|
|
478
512
|
const layout = sanitizeLayout(value, fallbackLayout);
|
|
@@ -497,6 +531,7 @@ function sanitizeSavedLayouts(
|
|
|
497
531
|
return [{ name: "Default", layout: cloneLayout(fallbackLayout) }];
|
|
498
532
|
}
|
|
499
533
|
|
|
534
|
+
const paneIds = savedPaneIds(value);
|
|
500
535
|
const layouts = value
|
|
501
536
|
.filter((entry): entry is SavedLayout =>
|
|
502
537
|
!!entry
|
|
@@ -504,7 +539,7 @@ function sanitizeSavedLayouts(
|
|
|
504
539
|
&& typeof (entry as SavedLayout).name === "string",
|
|
505
540
|
)
|
|
506
541
|
.map((entry) => {
|
|
507
|
-
const layout = sanitizeSavedLayoutOnce(entry.layout, fallbackLayout);
|
|
542
|
+
const layout = sanitizeSavedLayoutOnce(entry.layout, fallbackLayout, paneIds);
|
|
508
543
|
const placedPaneIds = new Set(getPlacedPaneInstanceIds(layout));
|
|
509
544
|
const paneState = sanitizeSavedPaneStateOnce((entry as { paneState?: unknown }).paneState, layout);
|
|
510
545
|
return {
|
package/src/i18n/es.ts
CHANGED
|
@@ -249,6 +249,15 @@ export const es: Record<string, string> = {
|
|
|
249
249
|
"Copy Screenshot": "Copiar captura",
|
|
250
250
|
"Share Pane": "Compartir panel",
|
|
251
251
|
"Pop Out": "Abrir en ventana",
|
|
252
|
+
"New Window": "Ventana nueva",
|
|
253
|
+
"Main Window": "Ventana principal",
|
|
254
|
+
"Window {number}": "Ventana {number}",
|
|
255
|
+
"Move to {window}": "Mover a {window}",
|
|
256
|
+
"Move to New Window": "Mover a una ventana nueva",
|
|
257
|
+
"Move Layout to {window}": "Mover diseño a {window}",
|
|
258
|
+
"Move Layout to New Window": "Mover diseño a una ventana nueva",
|
|
259
|
+
"Unlink from Pane in Another Window": "Desvincular del panel de otra ventana",
|
|
260
|
+
"Open another app window with its own layout tabs, for another screen": "Abrir otra ventana de la app con sus propias pestañas de diseño, para otra pantalla",
|
|
252
261
|
"Move Window...": "Mover ventana...",
|
|
253
262
|
"Change Ticker...": "Cambiar ticker...",
|
|
254
263
|
"Change Ticker": "Cambiar ticker",
|
|
@@ -1259,6 +1268,7 @@ export const es: Record<string, string> = {
|
|
|
1259
1268
|
"{count}m": "{count} min",
|
|
1260
1269
|
"{count}h": "{count} h",
|
|
1261
1270
|
"delayed data · upgrade": "datos diferidos · mejorar",
|
|
1271
|
+
"upgrade": "mejorar",
|
|
1262
1272
|
"real-time news": "noticias en tiempo real",
|
|
1263
1273
|
"Pro trial · {days}d left": "Prueba Pro · quedan {days} d",
|
|
1264
1274
|
"{delay} delayed": "{delay} de retraso",
|
package/src/i18n/ja.ts
CHANGED
|
@@ -250,6 +250,15 @@ export const ja: Record<string, string> = {
|
|
|
250
250
|
"Copy Screenshot": "スクリーンショットをコピー",
|
|
251
251
|
"Share Pane": "ペインを共有",
|
|
252
252
|
"Pop Out": "別ウィンドウで表示",
|
|
253
|
+
"New Window": "新規ウィンドウ",
|
|
254
|
+
"Main Window": "メインウィンドウ",
|
|
255
|
+
"Window {number}": "ウィンドウ {number}",
|
|
256
|
+
"Move to {window}": "{window} へ移動",
|
|
257
|
+
"Move to New Window": "新規ウィンドウへ移動",
|
|
258
|
+
"Move Layout to {window}": "レイアウトを {window} へ移動",
|
|
259
|
+
"Move Layout to New Window": "レイアウトを新規ウィンドウへ移動",
|
|
260
|
+
"Unlink from Pane in Another Window": "別ウィンドウのパネルとのリンクを解除",
|
|
261
|
+
"Open another app window with its own layout tabs, for another screen": "別の画面用に、専用のレイアウトタブを持つアプリウィンドウをもう一つ開く",
|
|
253
262
|
"Move Window...": "ウィンドウを移動...",
|
|
254
263
|
"Change Ticker...": "銘柄を変更...",
|
|
255
264
|
"Change Ticker": "銘柄を変更",
|
|
@@ -679,6 +688,7 @@ export const ja: Record<string, string> = {
|
|
|
679
688
|
"Pro trial {days}d": "Pro トライアル{days}日",
|
|
680
689
|
"Pro trial — ends {date}": "Pro トライアル — {date} まで",
|
|
681
690
|
"delayed data · upgrade": "データ遅延 · アップグレード",
|
|
691
|
+
"upgrade": "アップグレード",
|
|
682
692
|
"real-time news": "リアルタイムニュース",
|
|
683
693
|
"AI command bar": "AI コマンドバー",
|
|
684
694
|
"{amount}/mo": "{amount}/月",
|
package/src/i18n/ko.ts
CHANGED
|
@@ -248,6 +248,15 @@ export const ko: Record<string, string> = {
|
|
|
248
248
|
"Copy Screenshot": "스크린샷 복사",
|
|
249
249
|
"Share Pane": "창 공유",
|
|
250
250
|
"Pop Out": "별도 창으로 열기",
|
|
251
|
+
"New Window": "새 창",
|
|
252
|
+
"Main Window": "메인 창",
|
|
253
|
+
"Window {number}": "창 {number}",
|
|
254
|
+
"Move to {window}": "{window}(으)로 이동",
|
|
255
|
+
"Move to New Window": "새 창으로 이동",
|
|
256
|
+
"Move Layout to {window}": "레이아웃을 {window}(으)로 이동",
|
|
257
|
+
"Move Layout to New Window": "레이아웃을 새 창으로 이동",
|
|
258
|
+
"Unlink from Pane in Another Window": "다른 창의 패널과 연결 해제",
|
|
259
|
+
"Open another app window with its own layout tabs, for another screen": "다른 화면용으로 자체 레이아웃 탭이 있는 앱 창을 하나 더 열기",
|
|
251
260
|
"Move Window...": "창 이동...",
|
|
252
261
|
"Change Ticker...": "종목 변경...",
|
|
253
262
|
"Change Ticker": "종목 변경",
|
|
@@ -677,6 +686,7 @@ export const ko: Record<string, string> = {
|
|
|
677
686
|
"Pro trial {days}d": "Pro 체험 {days}일",
|
|
678
687
|
"Pro trial — ends {date}": "Pro 체험 — {date} 종료",
|
|
679
688
|
"delayed data · upgrade": "지연 데이터 · 업그레이드",
|
|
689
|
+
"upgrade": "업그레이드",
|
|
680
690
|
"real-time news": "실시간 뉴스",
|
|
681
691
|
"AI command bar": "AI 명령 바",
|
|
682
692
|
"{amount}/mo": "{amount}/월",
|
package/src/i18n/zh-cn.ts
CHANGED
|
@@ -250,6 +250,15 @@ export const zhCN: Record<string, string> = {
|
|
|
250
250
|
"Copy Screenshot": "复制截图",
|
|
251
251
|
"Share Pane": "分享窗格",
|
|
252
252
|
"Pop Out": "弹出窗口",
|
|
253
|
+
"New Window": "新建窗口",
|
|
254
|
+
"Main Window": "主窗口",
|
|
255
|
+
"Window {number}": "窗口 {number}",
|
|
256
|
+
"Move to {window}": "移到{window}",
|
|
257
|
+
"Move to New Window": "移到新窗口",
|
|
258
|
+
"Move Layout to {window}": "将布局移到{window}",
|
|
259
|
+
"Move Layout to New Window": "将布局移到新窗口",
|
|
260
|
+
"Unlink from Pane in Another Window": "取消与其他窗口面板的链接",
|
|
261
|
+
"Open another app window with its own layout tabs, for another screen": "为另一块屏幕再打开一个带有独立布局标签的应用窗口",
|
|
253
262
|
"Move Window...": "移动窗口...",
|
|
254
263
|
"Change Ticker...": "更改股票代码...",
|
|
255
264
|
"Change Ticker": "更改股票代码",
|
|
@@ -679,6 +688,7 @@ export const zhCN: Record<string, string> = {
|
|
|
679
688
|
"Pro trial {days}d": "Pro 试用 {days} 天",
|
|
680
689
|
"Pro trial — ends {date}": "Pro 试用 — {date} 结束",
|
|
681
690
|
"delayed data · upgrade": "数据延迟 · 升级",
|
|
691
|
+
"upgrade": "升级",
|
|
682
692
|
"real-time news": "实时新闻",
|
|
683
693
|
"AI command bar": "AI 命令栏",
|
|
684
694
|
"{amount}/mo": "{amount}/月",
|