gloomberb 0.20.4 → 0.20.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/README.md +3 -1
- package/README.zh-CN.md +1 -1
- package/bin/gloom +9 -0
- package/bin/without-bun.cjs +98 -0
- package/package.json +4 -1
- package/src/api-client/data.ts +148 -37
- package/src/api-client/hk-tenders.ts +59 -0
- package/src/api-client/index.ts +1 -0
- package/src/api-client/types/econ.ts +30 -0
- package/src/api-client/yield-curves.ts +1 -1
- package/src/app/global-shortcuts.ts +4 -1
- package/src/app/keybindings/actions.ts +6 -0
- package/src/app/keybindings/config.ts +2 -1
- package/src/app/keybindings/index.ts +1 -0
- package/src/app/keybindings/labels.ts +6 -1
- package/src/app/keybindings/resolve.ts +23 -4
- package/src/app/keybindings/terminal-keys.ts +35 -0
- package/src/app/pane-runtime/index.tsx +2 -2
- package/src/app/pane-runtime/ticker-open-runtime.ts +68 -40
- package/src/app.tsx +18 -13
- package/src/architecture/floating-promise-allowlist.json +313 -0
- package/src/architecture/ui-literals-allowlist.json +1 -1
- package/src/capabilities/chart-series.ts +27 -1
- package/src/cli/commands/keybindings.ts +5 -5
- package/src/cli/commands/market.ts +238 -57
- package/src/cli/commands/news-search.ts +81 -14
- package/src/cli/commands/overview.ts +27 -6
- package/src/cli/commands/remote.ts +16 -17
- package/src/cli/commands/system.ts +1 -1
- package/src/cli/commands/ticker.ts +3 -1
- package/src/cli/early-command.ts +2 -0
- package/src/cli/errors.ts +10 -1
- package/src/cli/fx-forward.ts +89 -7
- package/src/cli/fx-pair.ts +1 -1
- package/src/cli/fx-quote-rate.ts +23 -0
- package/src/cli/glossary.ts +19 -5
- package/src/cli/help.ts +1 -0
- package/src/cli/history-rows.ts +5 -3
- package/src/cli/index-roots.ts +5 -4
- package/src/cli/index.ts +40 -3
- package/src/cli/known-gaps.ts +38 -9
- package/src/cli/listing-arg.ts +17 -5
- package/src/cli/name-entries.ts +5 -1
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/options.ts +52 -3
- package/src/cli/output-file.ts +5 -3
- package/src/cli/pane-functions/catalog.ts +15 -0
- package/src/cli/pane-functions/function-help.ts +4 -4
- package/src/cli/pane-functions/headless.ts +9 -4
- package/src/cli/pane-functions/index.ts +6 -4
- package/src/cli/pane-functions/resolver.ts +2 -2
- package/src/cli/result.ts +21 -2
- package/src/cli/spreadsheet-hint.ts +7 -3
- package/src/cli/treasury-yields.ts +5 -3
- package/src/components/chart/composite/legend.tsx +40 -2
- package/src/components/command-bar/pane-settings.ts +2 -2
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/workflow/tickers.ts +2 -2
- package/src/components/data-table/view.tsx +9 -2
- package/src/components/input-search-bar.tsx +9 -2
- package/src/components/layout/pane/header.tsx +2 -0
- package/src/components/layout/shell/pane/capture.ts +4 -1
- package/src/components/layout/status-bar.tsx +6 -1
- package/src/components/onboarding/first-run-workspace.ts +44 -2
- package/src/components/onboarding/onboarding-frame.tsx +11 -2
- package/src/components/onboarding/onboarding-keyboard.ts +16 -0
- package/src/components/onboarding/onboarding-wizard.tsx +8 -8
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
- package/src/components/onboarding/use-onboarding-progress.ts +12 -4
- package/src/components/pane-settings-dialog/desktop.tsx +2 -2
- package/src/components/pane-settings-dialog/tui.tsx +2 -2
- package/src/components/pane-settings-dialog/value.ts +6 -0
- package/src/components/pane-settings-dialog.tsx +3 -3
- package/src/components/reader/detail-reader.tsx +4 -0
- package/src/components/ui/data-table/opentui/index.tsx +11 -4
- package/src/components/ui/data-table/opentui/model.ts +8 -6
- package/src/components/ui/data-table/types.ts +6 -1
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/page-stack-view.tsx +3 -0
- package/src/components/ui/pane-link-chip.tsx +269 -54
- package/src/components/ui/query-bar.tsx +2 -1
- package/src/components/ui/table-layout.ts +38 -1
- package/src/components/ui/tabs.tsx +97 -19
- package/src/core/state/app/layout-reducer.ts +7 -0
- package/src/core/state/app/layout.ts +44 -7
- package/src/core/state/app/state.ts +1 -1
- package/src/core/state/app/types.ts +22 -2
- package/src/docs/snapshot.json +30 -13
- package/src/market-data/depositary-pair.ts +5 -3
- package/src/market-data/market/change-basis.ts +9 -5
- package/src/market-data/market/dated-previous-close.ts +147 -17
- package/src/market-data/market/status.ts +17 -1
- package/src/market-data/quotes/contributions.ts +2 -0
- package/src/market-data/quotes/listing-enterprise-value.ts +50 -0
- package/src/plugins/builtin/alerts/metric-data.ts +15 -2
- package/src/plugins/builtin/analytics/risk-client.ts +10 -4
- package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
- package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
- package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
- package/src/plugins/builtin/awards/index.tsx +1 -1
- package/src/plugins/builtin/backtest/headless.ts +1 -1
- package/src/plugins/builtin/buildout/index.tsx +1 -0
- package/src/plugins/builtin/catalysts/index.tsx +2 -2
- package/src/plugins/builtin/cds/headless.ts +4 -0
- package/src/plugins/builtin/cds/model.ts +0 -6
- package/src/plugins/builtin/chart-composer/formula.ts +16 -3
- package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -0
- package/src/plugins/builtin/chart-composer/headless.ts +4 -2
- package/src/plugins/builtin/chart-composer/index.tsx +1 -0
- package/src/plugins/builtin/chart-composer/presets.ts +1 -0
- package/src/plugins/builtin/chat/content/composer.tsx +5 -4
- package/src/plugins/builtin/chat/content/index.tsx +12 -2
- package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
- package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
- package/src/plugins/builtin/chat/layout.ts +5 -2
- package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
- package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
- package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
- package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
- package/src/plugins/builtin/cloud/askg/pane.tsx +55 -13
- package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +5 -3
- package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
- package/src/plugins/builtin/company-attention/index.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +3 -1
- package/src/plugins/builtin/company-kpis/index.tsx +2 -2
- package/src/plugins/builtin/cot/index.tsx +1 -1
- package/src/plugins/builtin/cpi/index.tsx +1 -1
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +20 -7
- package/src/plugins/builtin/credit-boards/client.ts +8 -0
- package/src/plugins/builtin/credit-boards/headless.ts +4 -1
- package/src/plugins/builtin/credit-boards/model.ts +58 -4
- package/src/plugins/builtin/credit-boards/series.ts +63 -6
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +3 -2
- package/src/plugins/builtin/credit-conditions/headless.ts +24 -6
- package/src/plugins/builtin/credit-conditions/index.tsx +1 -1
- package/src/plugins/builtin/credit-conditions/model.ts +12 -6
- package/src/plugins/builtin/credit-conditions/series.ts +2 -1
- package/src/plugins/builtin/crypto-board/index.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
- package/src/plugins/builtin/doe/index.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
- package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
- package/src/plugins/builtin/econ/calendar-model.ts +115 -8
- package/src/plugins/builtin/econ/calendar-source.ts +7 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
- package/src/plugins/builtin/econ/index.tsx +42 -8
- package/src/plugins/builtin/econ/types.ts +3 -0
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
- package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
- package/src/plugins/builtin/executives/index.tsx +1 -0
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/fixed-income/index.tsx +3 -0
- package/src/plugins/builtin/futures-curve/headless.ts +3 -3
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +18 -0
- package/src/plugins/builtin/fx-matrix/index.tsx +44 -14
- package/src/plugins/builtin/gpu/index.tsx +1 -1
- package/src/plugins/builtin/help/functions-table.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +11 -1
- package/src/plugins/builtin/help/keybindings-editor.tsx +7 -3
- package/src/plugins/builtin/holders/index.tsx +1 -0
- package/src/plugins/builtin/holders/report-header.ts +2 -2
- package/src/plugins/builtin/insider/index.tsx +1 -0
- package/src/plugins/builtin/iv-history/index.tsx +1 -1
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/macro-day/headless.ts +27 -8
- package/src/plugins/builtin/macro-day/index.tsx +1 -1
- package/src/plugins/builtin/macro-day/model.ts +19 -3
- package/src/plugins/builtin/macro-day/pane.tsx +14 -9
- package/src/plugins/builtin/macro-day/releases.ts +25 -7
- package/src/plugins/builtin/market-valuation/index.tsx +1 -0
- package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
- package/src/plugins/builtin/members/index.tsx +1 -1
- package/src/plugins/builtin/mna/index.tsx +1 -0
- package/src/plugins/builtin/news/index.tsx +1 -0
- package/src/plugins/builtin/news/wire/index.tsx +5 -1
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
- package/src/plugins/builtin/options/index.tsx +1 -0
- package/src/plugins/builtin/options-positioning/index.tsx +1 -0
- package/src/plugins/builtin/pe-band/index.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
- package/src/plugins/builtin/portfolio-list/cli/render.ts +20 -3
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +5 -1
- package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
- package/src/plugins/builtin/power/index.tsx +1 -1
- package/src/plugins/builtin/realized-vol/index.tsx +1 -1
- package/src/plugins/builtin/research/headless-schema.ts +4 -3
- package/src/plugins/builtin/research/headless.ts +10 -4
- package/src/plugins/builtin/research/index.tsx +4 -0
- package/src/plugins/builtin/research/relative-valuation-columns.ts +145 -47
- package/src/plugins/builtin/research/relative-valuation-currency.ts +31 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +25 -8
- package/src/plugins/builtin/research/relative-valuation-model.ts +40 -9
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +3 -2
- package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -2
- package/src/plugins/builtin/research-search/index.tsx +1 -0
- package/src/plugins/builtin/research-search/pane.tsx +8 -0
- package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- package/src/plugins/builtin/scanner/headless.ts +52 -13
- package/src/plugins/builtin/seasonality/index.tsx +1 -1
- package/src/plugins/builtin/sec/index.tsx +1 -0
- package/src/plugins/builtin/series-inventory.ts +1 -1
- package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
- package/src/plugins/builtin/short-interest/index.tsx +1 -0
- package/src/plugins/builtin/social-mentions/index.tsx +1 -1
- package/src/plugins/builtin/supply-chain/index.tsx +1 -0
- package/src/plugins/builtin/thirteenf/api.ts +47 -4
- package/src/plugins/builtin/thirteenf/data.ts +43 -10
- package/src/plugins/builtin/thirteenf/headless.ts +55 -11
- package/src/plugins/builtin/thirteenf/model.ts +25 -9
- package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
- package/src/plugins/builtin/thirteenf/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +8 -7
- package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +8 -5
- package/src/plugins/builtin/ticker-detail/financials/model.ts +18 -2
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +6 -6
- package/src/plugins/builtin/ticker-detail/headless.ts +24 -17
- package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +6 -4
- package/src/plugins/builtin/time-sales/client.ts +9 -11
- package/src/plugins/builtin/time-sales/index.tsx +1 -1
- package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
- package/src/plugins/builtin/treasury-auctions/cache.ts +54 -5
- package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
- package/src/plugins/builtin/treasury-auctions/headless.ts +150 -22
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +126 -0
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +347 -0
- package/src/plugins/builtin/treasury-auctions/hk.ts +363 -0
- package/src/plugins/builtin/treasury-auctions/index.tsx +27 -4
- package/src/plugins/builtin/treasury-auctions/model.ts +264 -28
- package/src/plugins/builtin/treasury-auctions/pane.tsx +176 -41
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
- package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
- package/src/plugins/builtin/vol-surface/index.tsx +1 -1
- package/src/plugins/builtin/world-venue-map/index.ts +1 -0
- package/src/plugins/builtin/yield-curve/curves.ts +10 -4
- package/src/plugins/builtin/yield-curve/headless.ts +6 -2
- package/src/plugins/builtin/yield-curve/index.tsx +3 -3
- package/src/plugins/builtin/yield-curve/series.ts +10 -0
- package/src/plugins/builtin/yield-curve/world.ts +3 -1
- package/src/portfolio/collection-name.ts +22 -0
- package/src/portfolio/column-values.ts +2 -1
- package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
- package/src/public/remote.ts +7 -1
- package/src/remote/client.ts +191 -11
- package/src/remote/controller-utils.ts +13 -1
- package/src/remote/controller.ts +88 -26
- package/src/remote/endpoint.ts +24 -0
- package/src/remote/form.ts +59 -4
- package/src/remote/resources.ts +44 -18
- package/src/remote/schema.ts +21 -9
- package/src/remote/secrets.ts +12 -0
- package/src/remote/semantic-tree.tsx +14 -2
- package/src/remote/server.ts +2 -1
- package/src/remote/surface.tsx +192 -0
- package/src/remote/types.ts +5 -0
- package/src/renderers/dom/data-table/frozen-column.ts +3 -1
- package/src/renderers/dom/data-table/index.tsx +27 -9
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +27 -24
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +3 -3
- package/src/renderers/electrobun/bun/desktop/snapshot-commit.ts +77 -0
- package/src/renderers/electrobun/shared/protocol.ts +4 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +3 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +3 -0
- package/src/renderers/opentui/host.tsx +6 -0
- package/src/series/standalone.ts +2 -2
- package/src/shares/api.ts +21 -4
- package/src/shares/item.ts +73 -0
- package/src/shares/pane-item.ts +205 -0
- package/src/shares/pane.ts +4 -0
- package/src/shares/payload.ts +9 -5
- package/src/sources/gloomberb-cloud/news.ts +2 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +9 -5
- package/src/sources/provider-router/cache.ts +3 -1
- package/src/sync/controller.ts +17 -2
- package/src/sync/other-window-tabs.ts +32 -1
- package/src/sync/react.ts +4 -4
- package/src/tickers/renamed-listings.ts +105 -0
- package/src/tickers/search/index.ts +103 -16
- package/src/time-series/bar-spacing.ts +33 -0
- package/src/time-series/base-series.ts +21 -3
- package/src/time-series/chart-bounds.ts +31 -0
- package/src/time-series/field-catalog.ts +17 -0
- package/src/time-series/fundamentals.ts +143 -11
- package/src/time-series/ice-credit.ts +32 -6
- package/src/time-series/resolve.ts +11 -7
- package/src/time-series/session-bar.ts +78 -9
- package/src/time-series/studies/formula.ts +53 -10
- package/src/time-series/studies/pair.ts +18 -7
- package/src/time-series/studies/units.ts +49 -2
- package/src/time-series/types.ts +12 -0
- package/src/types/desktop-window.ts +2 -0
- package/src/types/financials.ts +7 -0
- package/src/types/headless.ts +8 -0
- package/src/types/plugin-pane-settings.ts +2 -0
- package/src/types/plugin-panes.ts +22 -0
- package/src/utils/central-banks.ts +86 -1
- package/src/utils/cli-output.ts +6 -3
- package/src/utils/datetime-format.ts +12 -3
- package/src/utils/depositary-receipt.ts +28 -3
- package/src/utils/ebitda.ts +128 -0
- package/src/utils/format.ts +1 -1
- package/src/utils/fundamentals.ts +14 -0
- package/src/utils/max-drawdown.ts +97 -16
- package/src/utils/shell-word.ts +13 -0
- package/src/utils/untrusted-text.ts +29 -0
|
@@ -9,6 +9,8 @@ import { formatPercentRaw } from "../../../utils/format";
|
|
|
9
9
|
import { Button, NumberField, TextField } from "../../ui";
|
|
10
10
|
import { DelayedMark } from "../../ui/delayed-mark";
|
|
11
11
|
import { useFreeQuoteDelay } from "../../../api-client/plan-access";
|
|
12
|
+
import { useRemoteUiNode } from "../../../remote/semantic-tree";
|
|
13
|
+
import { remoteStringValue } from "../../../remote/semantic-helpers";
|
|
12
14
|
import { ONBOARDING_DESKTOP } from "../onboarding-frame";
|
|
13
15
|
import {
|
|
14
16
|
POSITION_FIELDS,
|
|
@@ -379,7 +381,66 @@ export interface PositionsPanelProps {
|
|
|
379
381
|
shortcut: string;
|
|
380
382
|
}
|
|
381
383
|
|
|
384
|
+
/**
|
|
385
|
+
* One field of the position form as remote control fills it, the same on both
|
|
386
|
+
* hosts: the terminal draws only the field being typed in as an input, and
|
|
387
|
+
* Enter there is the card's key, not the input's. `submit` adds the position,
|
|
388
|
+
* as the desktop's Add button does.
|
|
389
|
+
*/
|
|
390
|
+
function RemotePositionField({ field, index, state, editing }: { field: PositionFieldId; index: number; state: OnboardingPositionsState; editing: boolean }) {
|
|
391
|
+
useRemoteUiNode({
|
|
392
|
+
role: "form-field",
|
|
393
|
+
label: fieldLabel(field, state),
|
|
394
|
+
disabled: state.submitting,
|
|
395
|
+
actions: {
|
|
396
|
+
focus: () => state.focusField(index),
|
|
397
|
+
setValue: (input) => state.setField(field, remoteStringValue(input)),
|
|
398
|
+
submit: () => state.addPosition(),
|
|
399
|
+
},
|
|
400
|
+
metadata: {
|
|
401
|
+
fieldId: field,
|
|
402
|
+
fieldType: field === "shares" || field === "avgCost" ? "number" : "text",
|
|
403
|
+
active: editing && index === state.fieldIdx,
|
|
404
|
+
value: state.draft[field],
|
|
405
|
+
placeholder: fieldPlaceholder(field, state),
|
|
406
|
+
...(field === "ticker" && state.error ? { error: state.error } : {}),
|
|
407
|
+
},
|
|
408
|
+
});
|
|
409
|
+
return null;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/** The positions added so far, as remote control reads them; `remove` takes one off by its symbol or index. */
|
|
413
|
+
function RemotePositionList({ state }: { state: OnboardingPositionsState }) {
|
|
414
|
+
useRemoteUiNode({
|
|
415
|
+
role: "list",
|
|
416
|
+
label: t("Positions"),
|
|
417
|
+
actions: {
|
|
418
|
+
remove: (input) => {
|
|
419
|
+
const record = input && typeof input === "object" ? input as { id?: unknown; index?: unknown } : {};
|
|
420
|
+
const symbol = typeof record.index === "number"
|
|
421
|
+
? state.positions[record.index]?.symbol
|
|
422
|
+
: typeof record.id === "string" ? record.id : remoteStringValue(input, "");
|
|
423
|
+
const row = state.positions.find((entry) => entry.symbol === symbol?.toUpperCase());
|
|
424
|
+
if (!row) throw new Error(`No position ${symbol ? `"${symbol}"` : "at that index"} is listed.`);
|
|
425
|
+
return state.removePosition(row.symbol);
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
metadata: {
|
|
429
|
+
items: state.positions.map((row, index) => ({ index, id: row.symbol, label: row.symbol, detail: positionSummary(row) })),
|
|
430
|
+
},
|
|
431
|
+
});
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
434
|
+
|
|
382
435
|
export function PositionsPanel(props: PositionsPanelProps) {
|
|
383
436
|
const desktop = useUiCapabilities().nativePaneChrome === true;
|
|
384
|
-
return
|
|
437
|
+
return (
|
|
438
|
+
<>
|
|
439
|
+
{POSITION_FIELDS.map((field, index) => (
|
|
440
|
+
<RemotePositionField key={field} field={field} index={index} state={props.state} editing={props.editing} />
|
|
441
|
+
))}
|
|
442
|
+
<RemotePositionList state={props.state} />
|
|
443
|
+
{desktop ? <DesktopPositionsPanel {...props} /> : <TuiPositionsPanel {...props} />}
|
|
444
|
+
</>
|
|
445
|
+
);
|
|
385
446
|
}
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
applyFirstRunLayout,
|
|
15
15
|
buildFirstRunLayout,
|
|
16
16
|
FIRST_RUN_WATCHLIST,
|
|
17
|
+
isCompactHomeViewport,
|
|
17
18
|
onboardingDeskLayoutId,
|
|
18
19
|
planFirstRunWatchlist,
|
|
19
20
|
setupDeskPicks,
|
|
@@ -28,6 +29,7 @@ import {
|
|
|
28
29
|
type BrokerOption,
|
|
29
30
|
} from "./wizard-model";
|
|
30
31
|
import { logFailure } from "../../utils/log-failure";
|
|
32
|
+
import { useViewport } from "../../react/input";
|
|
31
33
|
|
|
32
34
|
const onboardingLog = debugLog.createLogger("onboarding");
|
|
33
35
|
|
|
@@ -109,6 +111,10 @@ export function useOnboardingWorkspace({
|
|
|
109
111
|
const [deskCursor, setDeskCursor] = useState(0);
|
|
110
112
|
const [buildingDesks, setBuildingDesks] = useState(false);
|
|
111
113
|
const buildingDesksRef = useRef(false);
|
|
114
|
+
// The window the workspace is built for: a small terminal gets the compact Home.
|
|
115
|
+
const viewport = useViewport();
|
|
116
|
+
const viewportRef = useRef(viewport);
|
|
117
|
+
viewportRef.current = viewport;
|
|
112
118
|
|
|
113
119
|
/**
|
|
114
120
|
* Seeds the watchlist and swaps Home for the first-run workspace built
|
|
@@ -152,18 +158,20 @@ export function useOnboardingWorkspace({
|
|
|
152
158
|
onboardingLog.error("First-run watchlist update failed", { symbol: ticker.metadata.ticker, error: String(error) });
|
|
153
159
|
}
|
|
154
160
|
}
|
|
161
|
+
const { tickers, financials } = stateRef.current;
|
|
162
|
+
const held = [...tickers.values()]
|
|
163
|
+
.filter((ticker) => ticker.metadata.portfolios.includes(portfolioId))
|
|
164
|
+
.map((ticker) => ticker.metadata.ticker);
|
|
155
165
|
const home = buildFirstRunLayout({
|
|
156
166
|
symbol,
|
|
157
167
|
portfolioId,
|
|
158
168
|
watchlistId,
|
|
159
169
|
hasPane: (paneId) => pluginRegistry.panes?.has(paneId) ?? false,
|
|
170
|
+
compact: isCompactHomeViewport(viewportRef.current),
|
|
171
|
+
holdings: held.length > 0,
|
|
160
172
|
});
|
|
161
173
|
const workspace = applyFirstRunLayout(config, home, [], { rerun });
|
|
162
174
|
if (desks.length === 0) return workspace;
|
|
163
|
-
const { tickers, financials } = stateRef.current;
|
|
164
|
-
const held = [...tickers.values()]
|
|
165
|
-
.filter((ticker) => ticker.metadata.portfolios.includes(portfolioId))
|
|
166
|
-
.map((ticker) => ticker.metadata.ticker);
|
|
167
175
|
const company = pickDeskCompany([symbol, ...held], (candidate) => (
|
|
168
176
|
isDeskStock(tickers.get(candidate), financials.get(candidate))
|
|
169
177
|
));
|
|
@@ -7,7 +7,7 @@ import { Checkbox } from "../ui/checkbox";
|
|
|
7
7
|
import { Button } from "../ui/button";
|
|
8
8
|
import { Badge } from "../ui/display";
|
|
9
9
|
import { DialogFrame } from "../ui/frame";
|
|
10
|
-
import { isPaneSettingDisabled, noteColor, summarizePaneSettingValue } from "./value";
|
|
10
|
+
import { isPaneSettingDisabled, noteColor, paneSettingValue, summarizePaneSettingValue } from "./value";
|
|
11
11
|
|
|
12
12
|
const DESKTOP_TEXT_STYLE = {
|
|
13
13
|
letterSpacing: 0,
|
|
@@ -190,7 +190,7 @@ function DesktopSettingsList({
|
|
|
190
190
|
key={field.key}
|
|
191
191
|
field={field}
|
|
192
192
|
selected={index === selectedIndex}
|
|
193
|
-
currentValue={settings
|
|
193
|
+
currentValue={paneSettingValue(field, settings)}
|
|
194
194
|
note={noteFor?.(field) ?? null}
|
|
195
195
|
onHover={() => onHover(field, index)}
|
|
196
196
|
onEdit={() => onEdit(field, index)}
|
|
@@ -6,7 +6,7 @@ import { colors } from "../../theme/colors";
|
|
|
6
6
|
import { useViewport } from "../../react/input";
|
|
7
7
|
import { DialogFrame, ListView } from "../ui";
|
|
8
8
|
import type { ListViewProps } from "../ui/list-view";
|
|
9
|
-
import { isPaneSettingDisabled, noteColor, summarizePaneSettingValue } from "./value";
|
|
9
|
+
import { isPaneSettingDisabled, noteColor, paneSettingValue, summarizePaneSettingValue } from "./value";
|
|
10
10
|
|
|
11
11
|
/** Terminal rows a settings dialog spends around its list: edge, frame, title, description. */
|
|
12
12
|
const TUI_DIALOG_LIST_CHROME_ROWS = 11;
|
|
@@ -82,7 +82,7 @@ export function TuiPaneSettingsDialogBody({
|
|
|
82
82
|
id: field.key,
|
|
83
83
|
label: t(field.label),
|
|
84
84
|
description: notes[index]?.text ?? (field.description ? t(field.description) : field.description),
|
|
85
|
-
detail: notes[index]?.status ?? summarizePaneSettingValue(field, settings
|
|
85
|
+
detail: notes[index]?.status ?? summarizePaneSettingValue(field, paneSettingValue(field, settings)),
|
|
86
86
|
disabled: isPaneSettingDisabled(field),
|
|
87
87
|
}))}
|
|
88
88
|
descriptionColor={(index) => (notes[index]?.text ? noteColor(notes[index]) : undefined)}
|
|
@@ -17,6 +17,12 @@ export function noteColor(note: PaneSettingRowNote | null | undefined): string |
|
|
|
17
17
|
return note.tone === "negative" ? colors.negative : colors.warning;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/** A field's value in a pane's settings, an unset select reading as its default option. */
|
|
21
|
+
export function paneSettingValue(field: PaneSettingField, settings: Readonly<Record<string, unknown>>): unknown {
|
|
22
|
+
const value = settings[field.key];
|
|
23
|
+
return value == null && field.type === "select" ? field.defaultValue : value;
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
export function summarizePaneSettingValue(field: PaneSettingField, value: unknown): string {
|
|
21
27
|
switch (field.type) {
|
|
22
28
|
case "action":
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
TuiPaneSettingsDialogBody,
|
|
20
20
|
TuiUnavailablePaneSettingsDialog,
|
|
21
21
|
} from "./pane-settings-dialog/tui";
|
|
22
|
-
import { isPaneSettingDisabled, isSpaceKey, stepPaneSettingSelect } from "./pane-settings-dialog/value";
|
|
22
|
+
import { isPaneSettingDisabled, isSpaceKey, paneSettingValue, stepPaneSettingSelect } from "./pane-settings-dialog/value";
|
|
23
23
|
import { useRowNotes } from "./ui/row-notes";
|
|
24
24
|
import { logFailure } from "../utils/log-failure";
|
|
25
25
|
|
|
@@ -118,7 +118,7 @@ export function PaneSettingsDialogContent({
|
|
|
118
118
|
if (!closed && mounted.current) setSettingsRevision((revision) => revision + 1);
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
|
-
const currentValue = descriptor.context.settings
|
|
121
|
+
const currentValue = paneSettingValue(field, descriptor.context.settings);
|
|
122
122
|
|
|
123
123
|
if (field.type === "toggle") {
|
|
124
124
|
await applyAndRefresh(field, currentValue !== true);
|
|
@@ -175,7 +175,7 @@ export function PaneSettingsDialogContent({
|
|
|
175
175
|
/** Left and right change a toggle or step a select in place, the way a settings list does. */
|
|
176
176
|
const stepField = (field: PaneSettingField | undefined, direction: -1 | 1) => {
|
|
177
177
|
if (!field || !descriptor) return;
|
|
178
|
-
const currentValue = descriptor.context.settings
|
|
178
|
+
const currentValue = paneSettingValue(field, descriptor.context.settings);
|
|
179
179
|
if (field.type === "toggle") {
|
|
180
180
|
void applyAndRefresh(field, currentValue !== true).catch(logFailure("pane-settings-dialog", "Toggle pane setting failed"));
|
|
181
181
|
return;
|
|
@@ -9,6 +9,8 @@ import { DetailScrollBody } from "../ui/detail-scroll-body";
|
|
|
9
9
|
import { KeyValueRow } from "../ui/display";
|
|
10
10
|
import { ExternalLink, usePaneLinkMenuEntry } from "../ui/external-link";
|
|
11
11
|
import { parseArticle } from "./article-text";
|
|
12
|
+
import { shareItemExcerpt } from "../../shares/item";
|
|
13
|
+
import { usePaneShareItem } from "../../shares/pane-item";
|
|
12
14
|
import { DESKTOP_LINE_HEIGHT, READER_APP_FONT, READER_COLUMN_FONT, READER_HEADING_STYLE, READER_MEASURE, ReaderBlock, ReaderText, type ReaderGeometry } from "./reader-text";
|
|
13
15
|
|
|
14
16
|
export interface DetailFact {
|
|
@@ -82,6 +84,8 @@ export const DetailReader = forwardRef<ScrollBoxRenderable, DetailReaderProps>(f
|
|
|
82
84
|
ref,
|
|
83
85
|
) {
|
|
84
86
|
const { nativePaneChrome } = useUiCapabilities();
|
|
87
|
+
// The text's opening says what the open item is about, for a link to the pane.
|
|
88
|
+
usePaneShareItem(body ? () => ({ excerpt: shareItemExcerpt(body, { markdown: bodyFormat === "markdown" }) }) : null, { kit: true });
|
|
85
89
|
return (
|
|
86
90
|
<DetailScrollBody ref={ref} resetScrollKey={resetScrollKey}>
|
|
87
91
|
{nativePaneChrome
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
tableColumnStarts,
|
|
21
21
|
tableContentWidthProps,
|
|
22
22
|
tableFarEdgePad,
|
|
23
|
+
tableFreezesFirstColumn,
|
|
23
24
|
tableScrollStep,
|
|
24
25
|
useMeasuredTableContentWidth,
|
|
25
26
|
} from "../../table-layout";
|
|
@@ -131,7 +132,9 @@ function OpenTuiDataTableRowInner<
|
|
|
131
132
|
flexDirection="row"
|
|
132
133
|
height={1}
|
|
133
134
|
{...tableContentWidthProps(contentWidth)}
|
|
134
|
-
|
|
135
|
+
// Beside a pinned first column the heading stays in view too, not cut to its last letters.
|
|
136
|
+
paddingLeft={horizontalPadding + (frozenColumnOffset ?? 0)}
|
|
137
|
+
paddingRight={horizontalPadding}
|
|
135
138
|
backgroundColor={selected ? colors.selected : sectionHeader.backgroundColor ?? colors.bg}
|
|
136
139
|
onMouseDown={(event: any) => {
|
|
137
140
|
focusPane();
|
|
@@ -310,7 +313,7 @@ export function OpenTuiDataTable<T, C extends DataTableColumn = DataTableColumn>
|
|
|
310
313
|
horizontalPadding = 1,
|
|
311
314
|
fillAvailableWidth = true,
|
|
312
315
|
showHorizontalScrollbar = true,
|
|
313
|
-
freezeFirstColumn
|
|
316
|
+
freezeFirstColumn: freezeFirstColumnProp,
|
|
314
317
|
scrollToIndex,
|
|
315
318
|
scrollToIndexAlign = "nearest",
|
|
316
319
|
scrollToIndexVersion = 0,
|
|
@@ -375,6 +378,10 @@ export function OpenTuiDataTable<T, C extends DataTableColumn = DataTableColumn>
|
|
|
375
378
|
} = useMeasuredTableContentWidth(tableWidth, headerScrollRef, scrollRef);
|
|
376
379
|
const horizontalScrollbarVisible = showHorizontalScrollbar
|
|
377
380
|
&& hasMeaningfulTableHorizontalOverflow(tableWidth, measuredViewportWidth, columnGap);
|
|
381
|
+
const freezeFirstColumn = tableFreezesFirstColumn({
|
|
382
|
+
freezeFirstColumn: freezeFirstColumnProp, columns, columnGap, horizontalPadding, viewportWidth: measuredViewportWidth,
|
|
383
|
+
overflows: horizontalScrollbarVisible,
|
|
384
|
+
});
|
|
378
385
|
const contentWidth = fillAvailableWidth ? measuredContentWidth : tableWidth;
|
|
379
386
|
const sectionWidth = measuredViewportWidth > 0 ? Math.min(contentWidth, measuredViewportWidth) : contentWidth;
|
|
380
387
|
const displayColumns = useMemo(
|
|
@@ -390,7 +397,7 @@ export function OpenTuiDataTable<T, C extends DataTableColumn = DataTableColumn>
|
|
|
390
397
|
const scrollContentWidth = contentWidth + (freezeFirstColumn && horizontalScrollbarVisible
|
|
391
398
|
? tableFarEdgePad({ columns: displayColumns, columnGap, horizontalPadding, contentWidth, viewportWidth: measuredViewportWidth })
|
|
392
399
|
: 0);
|
|
393
|
-
// Columns out of view past the right edge: the header row ends in "more
|
|
400
|
+
// Columns out of view past the right edge: the header row ends in "more ⇧→" there, a press on it scrolls to
|
|
394
401
|
// them, and the rows leave its cells blank, so a narrow pane says it has more than it shows. The header's
|
|
395
402
|
// scroll box is as wide as the body's viewport (measuredViewportWidth), so the header row has a blank cell
|
|
396
403
|
// past it, over the body's vertical scrollbar; the hint is laid over the row, not inside the scroll box,
|
|
@@ -488,7 +495,7 @@ export function OpenTuiDataTable<T, C extends DataTableColumn = DataTableColumn>
|
|
|
488
495
|
scrollRef: headerScrollRef,
|
|
489
496
|
onHorizontalScroll: syncBodyScroll,
|
|
490
497
|
});
|
|
491
|
-
// "more
|
|
498
|
+
// "more ⇧→" steps right as Shift+Right does: half the viewport (beside a frozen column, to a column's edge).
|
|
492
499
|
const scrollToMoreColumns = useCallback(() => {
|
|
493
500
|
const body = scrollRef.current;
|
|
494
501
|
const viewportWidth = body?.viewport?.width ?? 0;
|
|
@@ -90,11 +90,13 @@ export function reuseDataTableColumnClips(
|
|
|
90
90
|
/**
|
|
91
91
|
* What a table's header says at its right edge while columns are out of view
|
|
92
92
|
* past it, longest first: the longest that fits beside the last column shown
|
|
93
|
-
* whole is drawn.
|
|
94
|
-
*
|
|
95
|
-
*
|
|
93
|
+
* whole is drawn. It names the key that scrolls there, Shift+Right in compact
|
|
94
|
+
* notation (`⇧→`): a plain Right switches a pane's tabs. With that column
|
|
95
|
+
* against the edge, the arrow takes the blank its label ends in. The hint
|
|
96
|
+
* never hides a column: with no blank to take, the horizontal scrollbar is
|
|
97
|
+
* the only sign.
|
|
96
98
|
*/
|
|
97
|
-
const MORE_COLUMNS_LABELS = ["more
|
|
99
|
+
const MORE_COLUMNS_LABELS = ["more ⇧→", "⇧→", "→"] as const;
|
|
98
100
|
|
|
99
101
|
export interface MoreColumnsHint {
|
|
100
102
|
/** The cells the hint draws: its label, after a blank unless it takes the last column's own. */
|
|
@@ -128,7 +130,7 @@ function hasColumnsPastRightEdge(columns: readonly HintColumn[], starts: readonl
|
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
/**
|
|
131
|
-
* The "more
|
|
133
|
+
* The "more ⇧→" hint at the header's right edge while columns are out of view
|
|
132
134
|
* past it, or null. The header's scroll box is as wide as the viewport, and
|
|
133
135
|
* `besideHeader` blank cells follow it on the header row (the cell over the
|
|
134
136
|
* body's vertical scrollbar); the hint, laid over the row, can reach them.
|
|
@@ -193,7 +195,7 @@ export function resolveMoreColumnsHint({
|
|
|
193
195
|
* Each column's clip at the current scroll, null for a column shown whole.
|
|
194
196
|
* A frozen first column stays, and what slides under it counts as cut on the
|
|
195
197
|
* left. `rightReserve` cells at the right edge show no column (under the
|
|
196
|
-
* "more
|
|
198
|
+
* "more ⇧→" hint, `resolveMoreColumnsHint`). Null for the whole table when every column is whole or nothing is
|
|
197
199
|
* measured yet.
|
|
198
200
|
*/
|
|
199
201
|
export function resolveDataTableColumnClips({
|
|
@@ -175,7 +175,12 @@ export interface DataTableProps<
|
|
|
175
175
|
horizontalPadding?: number;
|
|
176
176
|
fillAvailableWidth?: boolean;
|
|
177
177
|
showHorizontalScrollbar?: boolean;
|
|
178
|
-
/**
|
|
178
|
+
/**
|
|
179
|
+
* Keep the row identifier visible during horizontal scrolling. Unset, the
|
|
180
|
+
* first column is pinned while the table is too wide for its viewport and
|
|
181
|
+
* that column leaves the rest at least half of it (`tableFreezesFirstColumn`);
|
|
182
|
+
* `false` lets it scroll away.
|
|
183
|
+
*/
|
|
179
184
|
freezeFirstColumn?: boolean;
|
|
180
185
|
/** Append export-only source records after the displayed table. */
|
|
181
186
|
getExportMetadata?: () => readonly (readonly unknown[])[];
|
|
@@ -75,7 +75,7 @@ export { InlineQuickAddRow } from "./inline-quick-add";
|
|
|
75
75
|
export type { InlineQuickAddRowProps } from "./inline-quick-add";
|
|
76
76
|
|
|
77
77
|
export { ExternalLink, ExternalLinkText, openUrl, PaneLinkMenu, usePaneLinkMenuEntry } from "./external-link";
|
|
78
|
-
export { DesktopPaneLinkChip, TerminalPaneLinkChip } from "./pane-link-chip";
|
|
78
|
+
export { DesktopPaneLinkChip, TerminalPaneLinkChip, TerminalPaneLinkItemCard, terminalItemCardRows } from "./pane-link-chip";
|
|
79
79
|
export type { PaneLinkChipContent } from "./pane-link-chip";
|
|
80
80
|
export { ButtonActionScope } from "./action-scope";
|
|
81
81
|
export { RemoteImage } from "./remote-image";
|
|
@@ -2,6 +2,7 @@ import { Box, Text, TextAttributes, useUiHost } from "../../ui";
|
|
|
2
2
|
import { useShortcut } from "../../react/input";
|
|
3
3
|
import { useCallback, type ComponentType, type ReactNode } from "react";
|
|
4
4
|
import { colors } from "../../theme/colors";
|
|
5
|
+
import { usePaneShareItem } from "../../shares/pane-item";
|
|
5
6
|
import {
|
|
6
7
|
isDetailBackNavigationKey,
|
|
7
8
|
isMouseBackNavigationEvent,
|
|
@@ -31,6 +32,8 @@ export function PageStackView({
|
|
|
31
32
|
backHint,
|
|
32
33
|
}: PageStackViewProps) {
|
|
33
34
|
const HostPageStackView = useUiHost().PageStackView as ComponentType<PageStackViewProps> | undefined;
|
|
35
|
+
// The open detail's title names what the pane is on, for a link to it.
|
|
36
|
+
usePaneShareItem(detailOpen && detailTitle ? { title: detailTitle } : null, { kit: true });
|
|
34
37
|
const props = {
|
|
35
38
|
focused,
|
|
36
39
|
detailOpen,
|