gloomberb 0.20.13 → 0.20.16
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 +2 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +22 -4
- package/src/account/auth-dialog.tsx +22 -4
- package/src/account/auth-form.tsx +6 -1
- package/src/account/checkout-handoff.tsx +7 -14
- package/src/account/device-signin-dialog.tsx +35 -24
- package/src/api-client/crypto-markets.ts +10 -0
- package/src/api-client/errors.ts +3 -1
- package/src/api-client/index.ts +54 -0
- package/src/api-client/install-experiments.ts +8 -7
- package/src/api-client/money-markets.ts +7 -0
- package/src/api-client/paths.ts +2 -1
- package/src/api-client/product-waitlist.ts +63 -0
- package/src/api-client/request.ts +16 -4
- package/src/api-client/types/billing.ts +45 -0
- package/src/api-client/yearly-plan.ts +132 -0
- package/src/app/global-shortcuts.ts +5 -3
- package/src/app/pane-runtime/index.tsx +2 -2
- package/src/app/pane-runtime/plugin-bindings.ts +3 -1
- package/src/app/pane-runtime/ticker-open-runtime.ts +6 -1
- package/src/app/since-last-visit/keys.ts +26 -0
- package/src/app/since-last-visit/model.ts +266 -0
- package/src/app/since-last-visit/strip.tsx +193 -0
- package/src/app/since-last-visit/use-since-last-visit.ts +289 -0
- package/src/app/since-last-visit/visit-tracker.ts +191 -0
- package/src/app.tsx +15 -0
- package/src/architecture/floating-promise-allowlist.json +0 -1
- package/src/brokers/signed-in/sign-in-dialog.tsx +38 -38
- package/src/cli/commands/market.ts +103 -27
- package/src/cli/commands/overview.ts +18 -4
- package/src/cli/commands/system.ts +29 -1
- package/src/cli/commands/ticker.ts +12 -5
- package/src/cli/desktop-pane-shot-api-policy.ts +4 -1
- package/src/cli/desktop-pane-shot-browser.ts +2 -1
- package/src/cli/desktop-pane-shot-view.ts +3 -7
- package/src/cli/desktop-pane-shot.ts +26 -28
- package/src/cli/errors.ts +3 -1
- package/src/cli/freshness.ts +7 -2
- package/src/cli/glossary.ts +10 -5
- package/src/cli/help.ts +1 -0
- package/src/cli/helpers.ts +8 -16
- package/src/cli/history-export.ts +4 -0
- package/src/cli/history-rows.ts +24 -0
- package/src/cli/index.ts +4 -0
- package/src/cli/known-gaps.ts +2 -2
- package/src/cli/listing-arg.ts +79 -11
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/options.ts +29 -1
- package/src/cli/pane-functions/catalog.ts +70 -12
- package/src/cli/pane-functions/function-help.ts +1 -1
- package/src/cli/pane-functions/headless.ts +68 -3
- package/src/cli/pane-functions/index.ts +2 -2
- package/src/cli/pane-functions/options.ts +7 -0
- package/src/cli/pane-functions/resolver.ts +104 -15
- package/src/cli/pane-functions/screenshot-payload.ts +3 -0
- package/src/cli/report-tables.ts +20 -5
- package/src/cli/result.ts +22 -4
- package/src/cli/shot-temp-dir.ts +30 -0
- package/src/cli/suffixed-listing-rows.ts +11 -0
- package/src/cli/symbol-args.ts +5 -3
- package/src/cli/symbol-list.ts +23 -10
- package/src/cli/symbol-rows.ts +135 -3
- package/src/cli/treasury-yields.ts +15 -1
- package/src/components/chart/composite/composite-chart.tsx +3 -3
- package/src/components/chart/composite/format.ts +2 -1
- package/src/components/chart/composite/panel-surface/axis-markers.ts +133 -0
- package/src/components/chart/composite/panel-surface/level-labels.tsx +78 -0
- package/src/components/chart/composite/panel-surface/overlays.ts +108 -0
- package/src/components/chart/composite/panel-surface/pan-coast.ts +54 -0
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +138 -0
- package/src/components/chart/composite/panel-surface/panel-levels.ts +47 -0
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +403 -0
- package/src/components/chart/composite/panel-surface/plot-pointer.ts +65 -0
- package/src/components/chart/composite/panel-surface/plot-wheel.ts +102 -0
- package/src/components/chart/composite/panel-surface/pointer.ts +12 -0
- package/src/components/chart/composite/panel-surface/props.ts +79 -0
- package/src/components/chart/composite/panel-surface/tool-readout.ts +151 -0
- package/src/components/chart/composite/panel-surface/value-axis-gestures.ts +152 -0
- package/src/components/chart/composite/panel-surface.tsx +81 -1177
- package/src/components/command-bar/commands/collection-list.ts +1 -0
- package/src/components/command-bar/commands/direct/index.ts +31 -8
- package/src/components/command-bar/commands/registry.ts +7 -0
- package/src/components/command-bar/routes/root/command-items.ts +8 -0
- package/src/components/command-bar/routes/root/results.ts +19 -2
- package/src/components/command-bar/routes/root/runtime.ts +3 -2
- package/src/components/command-bar/routes/root/selection.ts +3 -2
- package/src/components/command-bar/routes/root/shortcuts.ts +15 -0
- package/src/components/company-logo.tsx +10 -3
- package/src/components/data-table/sections.ts +6 -1
- package/src/components/layout/pane/title.ts +16 -6
- package/src/components/layout/shell/index.tsx +5 -1
- package/src/components/layout/shell/ticker-link-menu.ts +12 -9
- package/src/components/pane-settings-dialog/tui.tsx +6 -3
- package/src/components/pane-settings-dialog.tsx +2 -1
- package/src/components/pane-template-wizard.tsx +2 -0
- package/src/components/ticker/badge/format.ts +12 -3
- package/src/components/ticker/badge/index.tsx +9 -3
- package/src/components/ticker/list-table-view.tsx +119 -17
- package/src/components/ui/choice-dialog.tsx +1 -1
- package/src/components/ui/confirm-dialog.tsx +3 -2
- package/src/components/ui/data-table/display-columns.ts +16 -0
- package/src/components/ui/data-table/index.tsx +40 -9
- package/src/components/ui/data-table/types.ts +14 -0
- package/src/components/ui/frame.tsx +7 -3
- package/src/components/ui/icon.tsx +4 -2
- package/src/components/ui/list-view.tsx +8 -0
- package/src/components/ui/number-prompt-dialog.tsx +2 -1
- package/src/components/use-pane-notice-footer.tsx +3 -1
- package/src/core/state/app/layout-reducer.ts +3 -1
- package/src/core/state/app/layout.ts +2 -2
- package/src/data/config/layout.ts +14 -0
- package/src/data/config/store/normalize.ts +11 -1
- package/src/docs/snapshot.json +2 -2
- package/src/i18n/es.ts +39 -0
- package/src/i18n/ja.ts +39 -0
- package/src/i18n/ko.ts +39 -0
- package/src/i18n/zh-cn.ts +39 -0
- package/src/i18n/zh-tw.ts +39 -0
- package/src/layout/pane-follow.ts +141 -4
- package/src/layout/pane-layout-move.ts +10 -7
- package/src/layout/ticker-navigation.ts +13 -19
- package/src/layout/ticker-retarget.ts +3 -2
- package/src/market-data/market/format.ts +35 -1
- package/src/market-data/market/index-level.ts +19 -0
- package/src/market-data/quotes/contributions.ts +13 -0
- package/src/market-data/quotes/export-identity.ts +36 -1
- package/src/market-data/quotes/resolution.ts +16 -0
- package/src/plugins/builtin/account-management/keyboard.ts +14 -0
- package/src/plugins/builtin/account-management/model.ts +2 -0
- package/src/plugins/builtin/account-management/pane.tsx +79 -7
- package/src/plugins/builtin/account-management/password-dialog.tsx +2 -2
- package/src/plugins/builtin/account-management/payment-recovery-row.tsx +97 -0
- package/src/plugins/builtin/account-management/yearly-plan-row.tsx +359 -0
- package/src/plugins/builtin/analytics/risk-client.ts +12 -2
- package/src/plugins/builtin/analytics/risk-headless.ts +66 -6
- package/src/plugins/builtin/analytics/risk-math.ts +23 -6
- package/src/plugins/builtin/analytics/risk-model.ts +20 -9
- package/src/plugins/builtin/analytics/risk-pane.tsx +2 -2
- package/src/plugins/builtin/awards/pane.tsx +6 -8
- package/src/plugins/builtin/changelog/index.tsx +6 -44
- package/src/plugins/builtin/changelog/versions.ts +17 -68
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +5 -2
- package/src/plugins/builtin/chart-composer/editor.tsx +1 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +1 -1
- package/src/plugins/builtin/chart-composer/quick-add.tsx +4 -1
- package/src/plugins/builtin/chart-composer/series-catalog.ts +17 -1
- package/src/plugins/builtin/cloud/askg/executor.ts +2 -1
- package/src/plugins/builtin/cloud/askg/sources.ts +2 -1
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/thesis/module.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +6 -2
- package/src/plugins/builtin/cpi/headless.ts +6 -1
- package/src/plugins/builtin/cpi/model.ts +17 -0
- package/src/plugins/builtin/cpi/pane.tsx +4 -2
- package/src/plugins/builtin/crypto-board/client.ts +6 -1
- package/src/plugins/builtin/crypto-board/headless.ts +10 -2
- package/src/plugins/builtin/crypto-board/model.ts +89 -11
- package/src/plugins/builtin/crypto-board/pane.tsx +20 -5
- package/src/plugins/builtin/debt-maturities/model.ts +1 -1
- package/src/plugins/builtin/dividend-yield/client.ts +24 -2
- package/src/plugins/builtin/dividend-yield/headless.ts +4 -2
- package/src/plugins/builtin/dividend-yield/ranking.ts +2 -1
- package/src/plugins/builtin/dividend-yield/view.ts +5 -1
- package/src/plugins/builtin/earnings/board-table.ts +1 -1
- package/src/plugins/builtin/earnings/board.tsx +36 -16
- package/src/plugins/builtin/earnings/highlight.ts +47 -0
- package/src/plugins/builtin/earnings/history-table.ts +9 -1
- package/src/plugins/builtin/earnings/index.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/pane.tsx +2 -2
- package/src/plugins/builtin/earnings-ripple/index.tsx +2 -0
- package/src/plugins/builtin/econ/calendar-model.ts +17 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +33 -4
- package/src/plugins/builtin/econ-statistics/headless.ts +21 -0
- package/src/plugins/builtin/estimate-revisions/model.ts +1 -1
- package/src/plugins/builtin/exposure/index.tsx +1 -1
- package/src/plugins/builtin/macro-day/headless.ts +21 -10
- package/src/plugins/builtin/macro-day/model.ts +42 -3
- package/src/plugins/builtin/macro-day/pane.tsx +26 -8
- package/src/plugins/builtin/macro-day/releases.ts +24 -1
- package/src/plugins/builtin/market-valuation/detail.tsx +3 -3
- package/src/plugins/builtin/market-valuation/headless.ts +11 -4
- package/src/plugins/builtin/market-valuation/pane.tsx +3 -1
- package/src/plugins/builtin/market-valuation/view.ts +14 -0
- package/src/plugins/builtin/money-markets/client.ts +4 -1
- package/src/plugins/builtin/money-markets/headless.ts +15 -4
- package/src/plugins/builtin/money-markets/index.tsx +1 -1
- package/src/plugins/builtin/money-markets/pane.tsx +7 -1
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +20 -8
- package/src/plugins/builtin/pe-band/pane.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -2
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +61 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +11 -3
- package/src/plugins/builtin/portfolio-list/cli/render.ts +8 -1
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +178 -17
- package/src/plugins/builtin/portfolio-list/headless.ts +33 -6
- package/src/plugins/builtin/portfolio-list/pane/groups.tsx +220 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +95 -18
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +24 -6
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +16 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +4 -1
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +6 -4
- package/src/plugins/builtin/portfolio-list/table.tsx +38 -16
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +4 -2
- package/src/plugins/builtin/research/relative-valuation-headless.ts +15 -5
- package/src/plugins/builtin/research/relative-valuation-model.ts +7 -1
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +7 -4
- package/src/plugins/builtin/shared/cloud-upgrade.ts +4 -2
- package/src/plugins/builtin/shared/cpi-year-gap.ts +67 -0
- package/src/plugins/builtin/shared/headless-options.ts +1 -1
- package/src/plugins/builtin/social-mentions/model.ts +2 -2
- package/src/plugins/builtin/thirteenf/pane.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +45 -2
- package/src/plugins/builtin/ticker-detail/financials/model.ts +51 -16
- package/src/plugins/builtin/ticker-detail/financials/nopat.ts +16 -0
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +44 -13
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +33 -2
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +4 -2
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +30 -4
- package/src/plugins/builtin/ticker-detail/headless.ts +280 -35
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +4 -5
- package/src/plugins/builtin/ticker-detail/overview/model.ts +9 -2
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +10 -2
- package/src/plugins/builtin/ticker-detail/pharma-signals/eligibility.ts +32 -0
- package/src/plugins/builtin/ticker-detail/pharma-signals/tab.tsx +162 -0
- package/src/plugins/builtin/ticker-detail/pharma-signals/waitlist.ts +126 -0
- package/src/plugins/builtin/ticker-detail/research-groups.ts +6 -4
- package/src/plugins/builtin/ticker-detail/research-tabs.ts +11 -0
- package/src/portfolio/collection-name.ts +2 -1
- package/src/portfolio/column-values.ts +34 -12
- package/src/portfolio/listed-symbol.ts +4 -2
- package/src/portfolio/period-pnl.ts +51 -1
- package/src/portfolio/suffixed-listings.ts +3 -1
- package/src/portfolio/watchlist-groups.ts +212 -0
- package/src/react/ticker-source.ts +3 -1
- package/src/renderers/dom/dialog-host.tsx +5 -5
- package/src/renderers/dom/styles.css +7 -0
- package/src/renderers/electrobun/view/remote/capability-invoker.ts +1 -1
- package/src/renderers/opentui/dialog-host.tsx +3 -4
- package/src/sources/gloomberb-cloud/normalizers.ts +5 -0
- package/src/sources/provider-router/history.ts +5 -2
- package/src/state/app/bootstrap.ts +11 -0
- package/src/state/app/context/index.tsx +6 -0
- package/src/sync/collections-contributor.ts +5 -2
- package/src/sync/config-merge.ts +10 -2
- package/src/sync/sanitize.ts +28 -0
- package/src/telemetry/usage-counts.ts +17 -0
- package/src/test-support/plugin-persistence.ts +12 -0
- package/src/tickers/company-name-listing.ts +4 -3
- package/src/tickers/company-name.ts +19 -1
- package/src/tickers/instrument-coverage.ts +27 -0
- package/src/tickers/search/home-listing.ts +38 -1
- package/src/tickers/search/index.ts +3 -2
- package/src/tickers/search/ranking.ts +21 -2
- package/src/time-series/base-series.ts +4 -0
- package/src/time-series/chart-seed.ts +1 -1
- package/src/time-series/financial-period-coverage.ts +4 -12
- package/src/time-series/parsed-history-cache.ts +1 -1
- package/src/time-series/resolve.ts +1 -1
- package/src/time-series/types.ts +5 -2
- package/src/time-series/use-chart-resolution.ts +6 -1
- package/src/types/config.ts +32 -0
- package/src/types/financials.ts +13 -0
- package/src/types/headless.ts +7 -0
- package/src/types/plugin-context.ts +5 -0
- package/src/types/ticker.ts +14 -0
- package/src/ui/ascii-font.ts +1 -4
- package/src/ui/dialog-stack.ts +17 -0
- package/src/ui/dialog.tsx +6 -2
- package/src/utils/async-deadline.ts +2 -2
- package/src/utils/crypto-pair.ts +9 -0
- package/src/utils/csv.ts +44 -5
- package/src/utils/exchanges.ts +13 -0
- package/src/utils/financial-statements.ts +60 -3
- package/src/utils/futures-generic.ts +17 -0
- package/src/utils/trailing-dividend.ts +13 -3
|
@@ -328,6 +328,7 @@ export async function addPastedListToWatchlist(options: {
|
|
|
328
328
|
),
|
|
329
329
|
// A saved alias of a holding is the holding's own record, as for the single add.
|
|
330
330
|
add: (ticker) => withCollectionMembership(resolveCollectionTicker(ticker, deps.getState().tickers, "watchlist", targetId), "watchlist", "add", targetId),
|
|
331
|
+
member: (ticker) => ticker.metadata.watchlists.includes(targetId),
|
|
331
332
|
});
|
|
332
333
|
|
|
333
334
|
for (const ticker of saved) {
|
|
@@ -244,14 +244,26 @@ export function runDirectCommandAction(options: {
|
|
|
244
244
|
return;
|
|
245
245
|
case "export-config": {
|
|
246
246
|
const exportPath = getDefaultConfigBackupPath();
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
247
|
+
// A file written to the home folder, over any copy there, says where before it is written: `config` and Enter
|
|
248
|
+
// once wrote it without a word.
|
|
249
|
+
openInlineConfirm({
|
|
250
|
+
confirmId: "export-config",
|
|
251
|
+
title: "Export Config",
|
|
252
|
+
body: [
|
|
253
|
+
`This saves your layouts, portfolios, watchlists, settings and recent commands to ${exportPath}, replacing any copy there.`,
|
|
254
|
+
],
|
|
255
|
+
confirmLabel: "Export",
|
|
256
|
+
cancelLabel: "Back",
|
|
257
|
+
onConfirm: async () => {
|
|
258
|
+
try {
|
|
259
|
+
await exportConfig(getState().config, exportPath);
|
|
260
|
+
notify(`Config exported to ${exportPath}`, { type: "success" });
|
|
261
|
+
closeAll({ revertThemePreview: false });
|
|
262
|
+
} catch (error) {
|
|
263
|
+
notify(error instanceof Error ? error.message : "Export failed.", { type: "error" });
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
});
|
|
255
267
|
return;
|
|
256
268
|
}
|
|
257
269
|
case "import-config": {
|
|
@@ -342,6 +354,17 @@ export function runDirectCommandAction(options: {
|
|
|
342
354
|
closeAll({ revertThemePreview: false });
|
|
343
355
|
return;
|
|
344
356
|
}
|
|
357
|
+
case "toggle-since-last-visit": {
|
|
358
|
+
// Only off is saved; on is the default.
|
|
359
|
+
const { sinceLastVisit, ...rest } = state.config;
|
|
360
|
+
const enabled = sinceLastVisit === false;
|
|
361
|
+
const nextConfig: AppConfig = enabled ? rest : { ...rest, sinceLastVisit: false };
|
|
362
|
+
dispatch({ type: "SET_CONFIG", config: nextConfig });
|
|
363
|
+
persistConfig(nextConfig);
|
|
364
|
+
notify(`${t(command.label)}: ${t(enabled ? "on" : "off")}`, { type: "success" });
|
|
365
|
+
closeAll({ revertThemePreview: false });
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
345
368
|
case "toggle-crash-reports":
|
|
346
369
|
case "toggle-usage-counts":
|
|
347
370
|
case "toggle-attention-counts": {
|
|
@@ -255,6 +255,13 @@ export const commands: Command[] = [
|
|
|
255
255
|
description: "Turn quote update flashing on or off",
|
|
256
256
|
category: "Config",
|
|
257
257
|
},
|
|
258
|
+
{
|
|
259
|
+
id: "toggle-since-last-visit",
|
|
260
|
+
prefix: "",
|
|
261
|
+
label: "Since Last Visit",
|
|
262
|
+
description: "Turn on or off the strip that shows what moved in your tickers since your last visit",
|
|
263
|
+
category: "Config",
|
|
264
|
+
},
|
|
258
265
|
{
|
|
259
266
|
id: "font-size-increase",
|
|
260
267
|
prefix: "FONT+",
|
|
@@ -176,6 +176,10 @@ export function createRootCommandItemBuilder({
|
|
|
176
176
|
return state.config.valueFlashingEnabled ? "Currently on" : "Currently off";
|
|
177
177
|
case "toggle-presentation-mode":
|
|
178
178
|
return state.config.presentationMode ? "Currently on" : "Currently off";
|
|
179
|
+
case "toggle-since-last-visit":
|
|
180
|
+
return state.config.sinceLastVisit === false
|
|
181
|
+
? "Currently off"
|
|
182
|
+
: "Currently on: what moved in your tickers shows above the layout when you come back";
|
|
179
183
|
case "toggle-crash-reports":
|
|
180
184
|
return state.config.telemetry?.crashReports === false ? "Currently off" : "Currently on";
|
|
181
185
|
case "toggle-usage-counts":
|
|
@@ -208,6 +212,8 @@ export function createRootCommandItemBuilder({
|
|
|
208
212
|
return state.config.telemetry?.usage === false ? "off" : "on";
|
|
209
213
|
case "toggle-attention-counts":
|
|
210
214
|
return state.config.telemetry?.attention === false ? "off" : "on";
|
|
215
|
+
case "toggle-since-last-visit":
|
|
216
|
+
return state.config.sinceLastVisit === false ? "off" : "on";
|
|
211
217
|
case "release-channel":
|
|
212
218
|
return resolveUpdateChannel(state.config);
|
|
213
219
|
default:
|
|
@@ -231,6 +237,8 @@ export function createRootCommandItemBuilder({
|
|
|
231
237
|
return "nightly stable beta prerelease update updates channel";
|
|
232
238
|
case "run-setup-again":
|
|
233
239
|
return "settings onboarding wizard guide first run start over desks holdings";
|
|
240
|
+
case "toggle-since-last-visit":
|
|
241
|
+
return "settings return strip what changed moves since away recap welcome back";
|
|
234
242
|
case "quit":
|
|
235
243
|
return "quit exit";
|
|
236
244
|
default:
|
|
@@ -18,7 +18,7 @@ import { isCollectionCommand, SECURITY_DESCRIPTION_SEARCH } from "../../helpers"
|
|
|
18
18
|
import { recentPaneTemplateArg } from "../../pane-templates/items";
|
|
19
19
|
import { dedupeById, PASTED_LIST_CATEGORY } from "../../view-model";
|
|
20
20
|
import type { ResultItem } from "../../list/model";
|
|
21
|
-
import { shortcutArgument, type parseRootShortcutIntent } from "./shortcuts";
|
|
21
|
+
import { commandShortcutQuery, shortcutArgument, type parseRootShortcutIntent } from "./shortcuts";
|
|
22
22
|
import type { CommandBarRoute } from "../../workflow/types";
|
|
23
23
|
import { createRootCommandItemBuilder } from "./command-items";
|
|
24
24
|
import { buildRootShortcutItem } from "./shortcut-items";
|
|
@@ -173,6 +173,16 @@ function buildBindKeyItem(
|
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
/** Words a query asks for the app's settings with. */
|
|
177
|
+
const CONFIG_QUERY_WORDS = new Set(["config", "configuration", "preferences", "prefs"]);
|
|
178
|
+
|
|
179
|
+
/** The commands that open or change one of the app's settings, in the order a settings query lists them: choices first. */
|
|
180
|
+
const APP_SETTING_COMMAND_IDS = [
|
|
181
|
+
"theme", "language", "header-market", "release-channel", "cycle-chart-renderer", "toggle-value-flashing", "toggle-since-last-visit",
|
|
182
|
+
"toggle-status-bar", "toggle-presentation-mode", "font-size-increase", "font-size-decrease", "toggle-crash-reports",
|
|
183
|
+
"toggle-usage-counts", "toggle-attention-counts", "check-for-updates",
|
|
184
|
+
];
|
|
185
|
+
|
|
176
186
|
/**
|
|
177
187
|
* Ranks a provider's in-memory rows with the local matches without reordering
|
|
178
188
|
* them: the provider decided which rows answer and in what order, so the block
|
|
@@ -301,7 +311,8 @@ export function buildRootResultModel(options: RootResultModelOptions): RootResul
|
|
|
301
311
|
});
|
|
302
312
|
|
|
303
313
|
const items: ResultItem[] = [];
|
|
304
|
-
|
|
314
|
+
// A command typed after its ticker (`MC FP Equity DES`) lists as typed first (`DES MC:EPA`).
|
|
315
|
+
const match = matchPrefix(commandShortcutQuery(rootQuery, rootShortcutIntent), availableCommands);
|
|
305
316
|
// A pasted list, which the bar flattens into one line, leads with adding its symbols. The AI is still offered.
|
|
306
317
|
const pastedList = rootShortcutIntent.kind === "none" && !match && rootQuery ? pastedRootList(rootQuery) : null;
|
|
307
318
|
let initialIdx = 0;
|
|
@@ -439,6 +450,12 @@ export function buildRootResultModel(options: RootResultModelOptions): RootResul
|
|
|
439
450
|
...pluginItems,
|
|
440
451
|
];
|
|
441
452
|
if (pastedList) items.push(pastedListItem(pastedList, executeCollectionCommand));
|
|
453
|
+
// `config` asks for the app's settings: each one, a choice to open first, ahead of Export and Import Config,
|
|
454
|
+
// which its words match by name and which write or replace a whole file.
|
|
455
|
+
if (CONFIG_QUERY_WORDS.has(rootQuery.trim().toLowerCase())) {
|
|
456
|
+
const byId = new Map(commandItems.map((item) => [item.id, item]));
|
|
457
|
+
items.push(...APP_SETTING_COMMAND_IDS.flatMap((id) => byId.get(id) ?? []));
|
|
458
|
+
}
|
|
442
459
|
items.push(...rankMatchBlock(allItems, providerMatchItems, rootQuery));
|
|
443
460
|
}
|
|
444
461
|
|
|
@@ -17,7 +17,7 @@ import { buildRootResultModel, type RootResultModel } from "./results";
|
|
|
17
17
|
import { useRootProviderSearch } from "./provider-search";
|
|
18
18
|
import { isProviderResultItem } from "./search-providers";
|
|
19
19
|
import { buildRootShortcutFeedback } from "./shortcut-feedback";
|
|
20
|
-
import type
|
|
20
|
+
import { commandShortcutQuery, type ShortcutIntent } from "./shortcuts";
|
|
21
21
|
import { clampIndex } from "../../../../utils/math";
|
|
22
22
|
|
|
23
23
|
/** Written the way a symbol is: up to five letters and a share class (AAPL, nvda, BRK.B). */
|
|
@@ -184,7 +184,8 @@ export function useCommandBarRootRuntime({
|
|
|
184
184
|
*/
|
|
185
185
|
const pinnedRootRowRef = useRef<{ id: string; answer: string | null } | null>(null);
|
|
186
186
|
const previousAnswerTookTopRef = useRef(0);
|
|
187
|
-
|
|
187
|
+
// `MC FP Equity DES` is `DES MC:EPA`, as `MC FP Equity GP` is `GP MC:EPA`.
|
|
188
|
+
const activeMatch = matchPrefix(commandShortcutQuery(rootQuery, rootShortcutIntent), availableCommands);
|
|
188
189
|
|
|
189
190
|
const tickerSearchRouteQuery = currentRoute?.kind === "mode" && currentRoute.screen === "ticker-search"
|
|
190
191
|
? currentRoute.query
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "../../helpers";
|
|
15
15
|
import type { ResultItem } from "../../list/model";
|
|
16
16
|
import { getPaneTemplateArgKind } from "../../pane-templates/items";
|
|
17
|
-
import { parseRootShortcutIntent, shortcutArgument } from "./shortcuts";
|
|
17
|
+
import { commandShortcutQuery, parseRootShortcutIntent, shortcutArgument } from "./shortcuts";
|
|
18
18
|
import { buildHelpArgumentItems } from "./help-items";
|
|
19
19
|
import { recordFunctionOpen } from "../../../../telemetry/usage-counts";
|
|
20
20
|
|
|
@@ -127,7 +127,8 @@ export function buildImmediateRootSelection(options: RootSelectionCommandOptions
|
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
// `MC FP Equity DES` runs as `DES MC:EPA`, as `MC FP Equity GP` opens GP.
|
|
131
|
+
const match = matchPrefix(commandShortcutQuery(options.query, intent), options.availableCommands);
|
|
131
132
|
if (!match) {
|
|
132
133
|
return null;
|
|
133
134
|
}
|
|
@@ -20,6 +20,8 @@ interface ShortcutIntentBase {
|
|
|
20
20
|
completionQuery: string | null;
|
|
21
21
|
/** The ticker in focus the argument was filled with, when none was typed. */
|
|
22
22
|
inferredArg?: string;
|
|
23
|
+
/** Typed in Bloomberg's order, the ticker before the code (`MC FP Equity DES`). */
|
|
24
|
+
tickerFirst?: true;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
interface CommandShortcutIntent extends ShortcutIntentBase {
|
|
@@ -43,6 +45,18 @@ export type ShortcutIntent =
|
|
|
43
45
|
| PaneTemplateShortcutIntent
|
|
44
46
|
| PluginCommandShortcutIntent;
|
|
45
47
|
|
|
48
|
+
/**
|
|
49
|
+
* The query a command runs as: one typed ticker first (`MC FP Equity DES`) in
|
|
50
|
+
* the code's own order (`DES MC:EPA`), so it lists, searches and opens on
|
|
51
|
+
* Enter as the code typed first does, as a pane's code typed after its ticker
|
|
52
|
+
* does (`MC FP Equity GP`). Any other query as typed.
|
|
53
|
+
*/
|
|
54
|
+
export function commandShortcutQuery(query: string, intent: ShortcutIntent): string {
|
|
55
|
+
return intent.kind !== "none" && intent.source === "command" && intent.tickerFirst && intent.argText
|
|
56
|
+
? `${intent.prefix} ${intent.argText}`
|
|
57
|
+
: query;
|
|
58
|
+
}
|
|
59
|
+
|
|
46
60
|
interface ShortcutParseCandidate {
|
|
47
61
|
prefix: string;
|
|
48
62
|
label: string;
|
|
@@ -239,6 +253,7 @@ export function parseRootShortcutIntent({
|
|
|
239
253
|
argText,
|
|
240
254
|
completionQuery,
|
|
241
255
|
...(kind === "inferred-complete" && inferredArg && issuer ? { inferredArg } : {}),
|
|
256
|
+
...(trimmed !== typed ? { tickerFirst: true as const } : {}),
|
|
242
257
|
};
|
|
243
258
|
|
|
244
259
|
if (match.source === "command" && match.command) {
|
|
@@ -8,6 +8,7 @@ import type { DataTableCell } from "./ui/data-table";
|
|
|
8
8
|
import { LogoMark, type LogoMarkProps } from "./ui/logo-mark";
|
|
9
9
|
import { canonicalExchange, canonicalTickerKey, isUsEquityExchange } from "../utils/exchanges";
|
|
10
10
|
import { tickerHasListingSuffix } from "../sources/listing-symbols";
|
|
11
|
+
import { isRoundTheClockCoin } from "../utils/crypto-pair";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* A company's listing as the logo service knows it: one abroad by its venue
|
|
@@ -26,7 +27,7 @@ export function resolveCompanyLogoSrc(input: {
|
|
|
26
27
|
/** The listing's venue, so a symbol a US company also uses draws its own company's logo. */
|
|
27
28
|
exchange?: string;
|
|
28
29
|
}): string | null {
|
|
29
|
-
const kind = logoKindForAsset(input.assetCategory);
|
|
30
|
+
const kind = logoKindForAsset(input.assetCategory, input.symbol, input.exchange);
|
|
30
31
|
if (!kind) return null;
|
|
31
32
|
const path = cloudLogoPath(kind, kind === "ticker" ? logoListing(input.symbol, input.exchange) : input.symbol);
|
|
32
33
|
return path ? `${getCloudApiBaseUrl()}${path}` : null;
|
|
@@ -124,8 +125,14 @@ export function CompanyLogo({
|
|
|
124
125
|
);
|
|
125
126
|
}
|
|
126
127
|
|
|
127
|
-
|
|
128
|
+
/**
|
|
129
|
+
* A coin is asked for on the crypto path, never as a ticker. A listing opened
|
|
130
|
+
* from its quote keeps no type (BTC-USD on CCC from a board row or a link), so
|
|
131
|
+
* without one its listing says whether it is a coin: a bare BTC is a US fund.
|
|
132
|
+
*/
|
|
133
|
+
function logoKindForAsset(assetCategory?: string, symbol?: string, exchange?: string): CloudLogoKind | null {
|
|
128
134
|
const kind = resolveAssetDisplayKind({ assetCategory });
|
|
129
135
|
if (kind === "cash" || kind === "contract") return null;
|
|
130
|
-
|
|
136
|
+
if (kind === "crypto") return "crypto";
|
|
137
|
+
return kind === "other" && isRoundTheClockCoin(symbol, exchange) ? "crypto" : "ticker";
|
|
131
138
|
}
|
|
@@ -47,8 +47,13 @@ export function isSectionedItemRow<T>(row: SectionedRow<T>): row is { kind: "ite
|
|
|
47
47
|
return row.kind === "item";
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/** A section header's text: its label and how many rows it holds, shown or collapsed. */
|
|
51
|
+
export function sectionHeaderText(label: string, count: number): string {
|
|
52
|
+
return `${label} (${count})`;
|
|
53
|
+
}
|
|
54
|
+
|
|
50
55
|
export function renderSectionedRowHeader<T>(row: SectionedRow<T>): DataTableSectionHeader | null {
|
|
51
|
-
return row.kind === "section" ? { text:
|
|
56
|
+
return row.kind === "section" ? { text: sectionHeaderText(row.label, row.count) } : null;
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
/** Row count a section list needs when the table is embedded at a fixed height. */
|
|
@@ -6,10 +6,16 @@ import {
|
|
|
6
6
|
type PaneInstanceConfig,
|
|
7
7
|
} from "../../../types/config";
|
|
8
8
|
import type { PaneDef } from "../../../types/plugin";
|
|
9
|
-
import { paneTitleMnemonic, TITLE_TICKER } from "../../../layout/pane-follow";
|
|
9
|
+
import { isUnlinkedFollower, paneTitleMnemonic, TITLE_TICKER } from "../../../layout/pane-follow";
|
|
10
10
|
import { canFollowTickerSource, isTickerLinkPeer } from "../../../layout/ticker-navigation";
|
|
11
|
+
import { withoutCryptoVenueCode } from "../../../utils/crypto-pair";
|
|
11
12
|
import { displayTickerKey } from "../../../utils/exchanges";
|
|
12
13
|
|
|
14
|
+
/** A ticker as a title names it: by its venue's own code, and a coin by its pair alone (USDT-USD, never USDT-USD:CCC). */
|
|
15
|
+
function titleTickerKey(key: string): string {
|
|
16
|
+
return withoutCryptoVenueCode(displayTickerKey(key));
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
/**
|
|
14
20
|
* A title a template wrote, its command and the ticker keys it opened on
|
|
15
21
|
* ("FA 9992:XHKG", "RV 9992:XHKG,PLTR"), with each key by its venue's code
|
|
@@ -22,7 +28,7 @@ function displayStoredTitle(title: string): string {
|
|
|
22
28
|
const parts = title.slice(mnemonic.length).split(/(\s*,\s*)/);
|
|
23
29
|
const keys = parts.filter((_, index) => index % 2 === 0).map((key) => key.trim());
|
|
24
30
|
if (!keys[0] || !keys.every((key) => TITLE_TICKER.test(key))) return title;
|
|
25
|
-
return `${title.slice(0, mnemonic.length)}${parts.map((part, index) => index % 2 === 0 ? part.replace(part.trim(),
|
|
31
|
+
return `${title.slice(0, mnemonic.length)}${parts.map((part, index) => index % 2 === 0 ? part.replace(part.trim(), titleTickerKey(part.trim())) : part).join("")}`;
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
/** Single-cell link glyph: emoji link icons render double-width in terminals. */
|
|
@@ -48,7 +54,7 @@ export function getBasePaneDisplayTitle(
|
|
|
48
54
|
|
|
49
55
|
if (instance.paneId === TICKER_RESEARCH_PANE_ID) {
|
|
50
56
|
const ticker = resolveTickerForPane(state as AppState, instance.instanceId);
|
|
51
|
-
if (ticker) return
|
|
57
|
+
if (ticker) return titleTickerKey(ticker);
|
|
52
58
|
const collectionId = resolveCollectionForPane(state as AppState, instance.instanceId);
|
|
53
59
|
return state.config.portfolios.find((portfolio) => portfolio.id === collectionId)?.name
|
|
54
60
|
?? state.config.watchlists.find((watchlist) => watchlist.id === collectionId)?.name
|
|
@@ -62,7 +68,7 @@ export function getBasePaneDisplayTitle(
|
|
|
62
68
|
: null;
|
|
63
69
|
if (mnemonic) {
|
|
64
70
|
const ticker = resolveTickerForPane(state as AppState, instance.instanceId);
|
|
65
|
-
return ticker ? `${mnemonic} ${
|
|
71
|
+
return ticker ? `${mnemonic} ${titleTickerKey(ticker)}` : mnemonic;
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
if (instance.title) return displayStoredTitle(instance.title);
|
|
@@ -78,7 +84,7 @@ export function getBasePaneDisplayTitle(
|
|
|
78
84
|
if (paneDef.tickerSource) return t(paneDef.name);
|
|
79
85
|
|
|
80
86
|
const ticker = resolveTickerForPane(state as AppState, instance.instanceId);
|
|
81
|
-
return ticker ? `${t(paneDef.name)}: ${
|
|
87
|
+
return ticker ? `${t(paneDef.name)}: ${titleTickerKey(ticker)}` : t(paneDef.name);
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
export function getPaneDisplayTitle(
|
|
@@ -88,9 +94,13 @@ export function getPaneDisplayTitle(
|
|
|
88
94
|
panes?: ReadonlyMap<string, PaneDef>,
|
|
89
95
|
): string {
|
|
90
96
|
const title = getBasePaneDisplayTitle(state, instance, paneDef, panes);
|
|
91
|
-
if (
|
|
97
|
+
if (!panes) return title;
|
|
92
98
|
const research = instance.paneId === TICKER_RESEARCH_PANE_ID;
|
|
93
99
|
if (!research && !canFollowTickerSource(instance, panes)) return title;
|
|
100
|
+
// A pane its link left (an unlink, its source closed, or another research pane took it) says
|
|
101
|
+
// so where it named the source, until it follows a pane again.
|
|
102
|
+
if (isUnlinkedFollower(instance)) return `${title} ${LINK_GLYPH} ${t("Unlinked")}`;
|
|
103
|
+
if (instance.binding?.kind !== "follow") return title;
|
|
94
104
|
|
|
95
105
|
const source = findPaneInstance(state.config.layout, instance.binding.sourceInstanceId);
|
|
96
106
|
const sourceDef = source ? panes.get(source.paneId) : null;
|
|
@@ -98,6 +98,8 @@ interface ShellProps {
|
|
|
98
98
|
desktopWindowBridge?: DesktopWindowBridge;
|
|
99
99
|
desktopDockPreview?: DesktopDockPreviewState | null;
|
|
100
100
|
commandBarNativeOccluder?: LayoutBounds | null;
|
|
101
|
+
/** Rows of app chrome between the header and the layout (the since-last-visit strip). */
|
|
102
|
+
topBandRows?: number;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
interface TransientFocusLayoutState {
|
|
@@ -114,6 +116,7 @@ export function Shell({
|
|
|
114
116
|
desktopWindowBridge,
|
|
115
117
|
desktopDockPreview,
|
|
116
118
|
commandBarNativeOccluder = null,
|
|
119
|
+
topBandRows = 0,
|
|
117
120
|
}: ShellProps) {
|
|
118
121
|
const colors = useThemeColors();
|
|
119
122
|
const dispatch = useAppDispatch();
|
|
@@ -143,7 +146,8 @@ export function Shell({
|
|
|
143
146
|
const shellRef = useRef<BoxRenderable | null>(null);
|
|
144
147
|
|
|
145
148
|
const chrome = useAppChromeShown();
|
|
146
|
-
|
|
149
|
+
// Where the layout starts: the header, then any band of chrome under it.
|
|
150
|
+
const appHeaderHeight = (chrome.header ? resolveAppHeaderHeightCells({ titleBarOverlay, cellHeightPx }) : 0) + topBandRows;
|
|
147
151
|
const contentHeight = Math.max(1, height - appHeaderHeight - (chrome.statusBar ? 1 : 0));
|
|
148
152
|
pluginRegistry.bindHost({ getTermSize: () => ({ width, height: contentHeight }) });
|
|
149
153
|
|
|
@@ -2,13 +2,12 @@ import { tf } from "../../../i18n";
|
|
|
2
2
|
import { updatePaneInstance } from "../../../pane-settings";
|
|
3
3
|
import {
|
|
4
4
|
canFollowTickerSource,
|
|
5
|
-
followBindingReaches,
|
|
6
5
|
isTickerLinkPeer,
|
|
7
6
|
} from "../../../layout/ticker-navigation";
|
|
8
7
|
import { isPaneInLayout } from "../../../layout/pane-manager";
|
|
9
8
|
import { resolveTickerForPane, type AppState } from "../../../state/app/context";
|
|
10
9
|
import { resolveInstrumentForPane } from "../../../core/state/app/instrument";
|
|
11
|
-
import { paneTitleMnemonic, pinFollowingPane } from "../../../layout/pane-follow";
|
|
10
|
+
import { followBindingReaches, linkFollower, paneTitleMnemonic, pinFollowingPane } from "../../../layout/pane-follow";
|
|
12
11
|
import {
|
|
13
12
|
findPaneInstance,
|
|
14
13
|
TICKER_RESEARCH_PANE_ID,
|
|
@@ -45,11 +44,15 @@ export function tickerLinkMenuItems({
|
|
|
45
44
|
const linkable = research || canFollowTickerSource(instance, panes);
|
|
46
45
|
|
|
47
46
|
const sourceInstanceId = instance.binding?.kind === "follow" ? instance.binding.sourceInstanceId : null;
|
|
47
|
+
const sourcePaneId = (id: string) => findPaneInstance(layout, id)?.paneId;
|
|
48
48
|
const unlink = (symbol: string) => {
|
|
49
49
|
const contract = resolveInstrumentForPane(state, instance.instanceId)?.instrument;
|
|
50
50
|
persistLayout(updatePaneInstance(layout, instance.instanceId, (current) => {
|
|
51
51
|
const mnemonic = research ? null : paneTitleMnemonic(current.title);
|
|
52
|
-
|
|
52
|
+
// The user's own unlink: the pane stays on its ticker until they link it again.
|
|
53
|
+
return pinFollowingPane(mnemonic ? { ...current, title: mnemonic } : current, symbol, contract, {
|
|
54
|
+
sourcePaneId: sourceInstanceId ? sourcePaneId(sourceInstanceId) : undefined,
|
|
55
|
+
});
|
|
53
56
|
}));
|
|
54
57
|
};
|
|
55
58
|
const linkToSource = (nextSourceId: string) => {
|
|
@@ -59,11 +62,7 @@ export function tickerLinkMenuItems({
|
|
|
59
62
|
if (current.instanceId === instance.instanceId) {
|
|
60
63
|
// The stored title drops its ticker ("OMON AAPL" to "OMON"); the header adds the live one.
|
|
61
64
|
const mnemonic = research ? null : paneTitleMnemonic(current.title);
|
|
62
|
-
return {
|
|
63
|
-
...current,
|
|
64
|
-
...(mnemonic ? { title: mnemonic } : {}),
|
|
65
|
-
binding: { kind: "follow" as const, sourceInstanceId: nextSourceId },
|
|
66
|
-
};
|
|
65
|
+
return linkFollower(mnemonic ? { ...current, title: mnemonic } : current, nextSourceId);
|
|
67
66
|
}
|
|
68
67
|
// Ticker Research keeps one follower per source, so Enter on a source row has one target.
|
|
69
68
|
// Any number of other panes may follow the same source.
|
|
@@ -73,7 +72,11 @@ export function tickerLinkMenuItems({
|
|
|
73
72
|
|| current.binding?.kind !== "follow"
|
|
74
73
|
|| current.binding.sourceInstanceId !== nextSourceId
|
|
75
74
|
) return current;
|
|
76
|
-
|
|
75
|
+
// The pane it displaces follows the source again once this one leaves it.
|
|
76
|
+
return pinFollowingPane(current, resolveTickerForPane(state as AppState, current.instanceId), undefined, {
|
|
77
|
+
auto: true,
|
|
78
|
+
sourcePaneId: sourcePaneId(nextSourceId),
|
|
79
|
+
});
|
|
77
80
|
}),
|
|
78
81
|
});
|
|
79
82
|
};
|
|
@@ -48,9 +48,9 @@ export function TuiDialogList({ descriptionColor, ...props }: ListViewProps & {
|
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export function TuiUnavailablePaneSettingsDialog() {
|
|
51
|
+
export function TuiUnavailablePaneSettingsDialog({ dismiss }: { dismiss?: () => void }) {
|
|
52
52
|
return (
|
|
53
|
-
<DialogFrame title={t("Pane Settings")} footer={t("Press esc to cancel")}>
|
|
53
|
+
<DialogFrame title={t("Pane Settings")} footer={t("Press esc to cancel")} onClose={dismiss}>
|
|
54
54
|
<Text fg={colors.textDim}>{t("This pane is no longer configurable.")}</Text>
|
|
55
55
|
</DialogFrame>
|
|
56
56
|
);
|
|
@@ -58,6 +58,7 @@ export function TuiUnavailablePaneSettingsDialog() {
|
|
|
58
58
|
|
|
59
59
|
export function TuiPaneSettingsDialogBody({
|
|
60
60
|
title,
|
|
61
|
+
dismiss,
|
|
61
62
|
fields,
|
|
62
63
|
selectedIndex,
|
|
63
64
|
settings,
|
|
@@ -66,6 +67,8 @@ export function TuiPaneSettingsDialogBody({
|
|
|
66
67
|
onActivate,
|
|
67
68
|
}: {
|
|
68
69
|
title: string;
|
|
70
|
+
/** The close button in the title, for a mouse; Esc closes too. */
|
|
71
|
+
dismiss?: () => void;
|
|
69
72
|
fields: PaneSettingField[];
|
|
70
73
|
selectedIndex: number;
|
|
71
74
|
settings: Record<string, unknown>;
|
|
@@ -76,7 +79,7 @@ export function TuiPaneSettingsDialogBody({
|
|
|
76
79
|
}) {
|
|
77
80
|
const notes = fields.map((field) => noteFor?.(field) ?? null);
|
|
78
81
|
return (
|
|
79
|
-
<DialogFrame title={t(title)}>
|
|
82
|
+
<DialogFrame title={t(title)} onClose={dismiss}>
|
|
80
83
|
<TuiDialogList
|
|
81
84
|
items={fields.map((field, index) => ({
|
|
82
85
|
id: field.key,
|
|
@@ -209,7 +209,7 @@ export function PaneSettingsDialogContent({
|
|
|
209
209
|
if (!descriptor) {
|
|
210
210
|
return isDesktop
|
|
211
211
|
? <DesktopUnavailablePaneSettingsDialog dismiss={dismiss} />
|
|
212
|
-
: <TuiUnavailablePaneSettingsDialog />;
|
|
212
|
+
: <TuiUnavailablePaneSettingsDialog dismiss={dismiss} />;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
const title = descriptor.settingsDef.title ?? `${descriptor.paneDef.name} Settings`;
|
|
@@ -236,6 +236,7 @@ export function PaneSettingsDialogContent({
|
|
|
236
236
|
) : (
|
|
237
237
|
<TuiPaneSettingsDialogBody
|
|
238
238
|
title={title}
|
|
239
|
+
dismiss={dismiss}
|
|
239
240
|
fields={fields}
|
|
240
241
|
selectedIndex={selectedIndex}
|
|
241
242
|
settings={descriptor.context.settings}
|
|
@@ -9,6 +9,7 @@ import { t, tf } from "../i18n";
|
|
|
9
9
|
|
|
10
10
|
export function PaneTemplateInputStep({
|
|
11
11
|
resolve,
|
|
12
|
+
dismiss,
|
|
12
13
|
step,
|
|
13
14
|
}: PromptContext<string> & { step: WizardStep }) {
|
|
14
15
|
const inputRef = useRef<InputRenderable>(null);
|
|
@@ -21,6 +22,7 @@ export function PaneTemplateInputStep({
|
|
|
21
22
|
return (
|
|
22
23
|
<DialogFrame
|
|
23
24
|
title={step.label}
|
|
25
|
+
onClose={dismiss}
|
|
24
26
|
footer={step.defaultValue
|
|
25
27
|
? `Press Enter to use ${step.defaultValue}`
|
|
26
28
|
: step.required === false
|
|
@@ -59,21 +59,30 @@ export interface TickerBadgeTextOptions {
|
|
|
59
59
|
* worse than no price, so the badge drops back to whatever still fits.
|
|
60
60
|
*/
|
|
61
61
|
maxTextWidth?: number;
|
|
62
|
+
/**
|
|
63
|
+
* A move in percent to say instead of the day's change, over a span the
|
|
64
|
+
* caller names beside the chips (since the user's last visit).
|
|
65
|
+
*/
|
|
66
|
+
move?: number;
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
/**
|
|
65
|
-
* Candidates run richest first: the day's change
|
|
66
|
-
*
|
|
70
|
+
* Candidates run richest first: the move (the day's change unless the caller
|
|
71
|
+
* gives another), then the bare symbol, which always fits because the caller
|
|
72
|
+
* sized the column for it.
|
|
67
73
|
*/
|
|
68
74
|
function tickerBadgeTextCandidates({
|
|
69
75
|
symbol,
|
|
70
76
|
status,
|
|
71
77
|
quote,
|
|
72
78
|
liveQuote = true,
|
|
79
|
+
move,
|
|
73
80
|
}: TickerBadgeTextOptions): string[] {
|
|
74
81
|
const candidates: string[] = [];
|
|
75
82
|
if (liveQuote) {
|
|
76
|
-
if (status === "ready" &&
|
|
83
|
+
if (status === "ready" && move != null && Number.isFinite(move)) {
|
|
84
|
+
candidates.push(`${symbol} ${formatTickerBadgeChange(move)}`);
|
|
85
|
+
} else if (status === "ready" && quote && Number.isFinite(quote.changePercent)) {
|
|
77
86
|
candidates.push(`${symbol} ${formatTickerBadgeChange(quote.changePercent)}`);
|
|
78
87
|
} else if (status === "loading") {
|
|
79
88
|
candidates.push(`${symbol} \u2026`);
|
|
@@ -21,6 +21,8 @@ export interface TickerBadgeProps {
|
|
|
21
21
|
maxTextWidth?: number;
|
|
22
22
|
/** Trailing gap to the next chip, which the last chip in a row does not need. */
|
|
23
23
|
trailingGap?: boolean;
|
|
24
|
+
/** A move in percent the chip says and takes its tone from, instead of the day's change. */
|
|
25
|
+
move?: number;
|
|
24
26
|
onHoverStart?: () => void;
|
|
25
27
|
onHoverEnd?: () => void;
|
|
26
28
|
onOpen: (symbol: string) => void;
|
|
@@ -46,6 +48,7 @@ export function TickerBadge({
|
|
|
46
48
|
hovered = false,
|
|
47
49
|
maxTextWidth,
|
|
48
50
|
trailingGap = true,
|
|
51
|
+
move,
|
|
49
52
|
onHoverStart,
|
|
50
53
|
onHoverEnd,
|
|
51
54
|
onOpen,
|
|
@@ -61,11 +64,14 @@ export function TickerBadge({
|
|
|
61
64
|
onOpen,
|
|
62
65
|
});
|
|
63
66
|
const quoteForDisplay = liveQuote ? quote : null;
|
|
64
|
-
const
|
|
67
|
+
const shownMove = liveQuote && move != null && Number.isFinite(move) ? move : null;
|
|
68
|
+
const tone = status === "ready" && shownMove != null
|
|
69
|
+
? priceColor(shownMove)
|
|
70
|
+
: status === "ready" && quoteForDisplay
|
|
65
71
|
? priceColor(quoteForDisplay.changePercent)
|
|
66
72
|
: colors.borderFocused;
|
|
67
|
-
const text = getTickerBadgeText({ symbol, status, quote, liveQuote, maxTextWidth });
|
|
68
|
-
const price = hovered ? getTickerBadgeHoverText({ symbol, status, quote, liveQuote, maxTextWidth }) : null;
|
|
73
|
+
const text = getTickerBadgeText({ symbol, status, quote, liveQuote, maxTextWidth, move });
|
|
74
|
+
const price = hovered ? getTickerBadgeHoverText({ symbol, status, quote, liveQuote, maxTextWidth, move }) : null;
|
|
69
75
|
const { fg: color, bg: backgroundColor } = tickerBadgeColors(tone, hovered);
|
|
70
76
|
// An ambiguous symbol is worth opening: that is how the listing gets picked.
|
|
71
77
|
const interactive = status !== "loading";
|