@gloom-sh/terminal 0.20.3 → 0.20.5
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 +2 -0
- package/bin/gloom +9 -0
- package/bin/without-bun.cjs +98 -0
- package/package.json +3 -1
- package/src/account/auth-dialog.tsx +17 -0
- package/src/api-client/data.ts +144 -35
- package/src/api-client/fx-interventions.ts +64 -0
- package/src/api-client/index.ts +1 -0
- package/src/api-client/release-summaries.ts +21 -0
- package/src/api-client/types/econ.ts +12 -0
- package/src/api-client/yield-curves.ts +1 -1
- package/src/app/global-shortcuts.ts +4 -1
- package/src/app/keybindings/actions.ts +8 -2
- 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 +274 -67
- 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 +154 -21
- package/src/cli/commands/news-search.ts +60 -10
- package/src/cli/commands/overview.ts +16 -1
- package/src/cli/commands/plugins.ts +27 -5
- package/src/cli/commands/remote.ts +16 -17
- package/src/cli/commands/system.ts +20 -4
- package/src/cli/commands/ticker.ts +60 -19
- package/src/cli/fx-forward.ts +25 -7
- package/src/cli/glossary.ts +19 -5
- package/src/cli/history-rows.ts +5 -3
- package/src/cli/index.ts +8 -8
- package/src/cli/known-gaps.ts +27 -1
- package/src/cli/listing-arg.ts +11 -1
- package/src/cli/name-entries.ts +5 -1
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/function-help.ts +5 -5
- package/src/cli/report-tables.ts +18 -6
- package/src/cli/result.ts +15 -7
- package/src/cli/types.ts +2 -0
- package/src/components/chart/composite/axis-overlays.tsx +22 -0
- package/src/components/chart/composite/composite-chart.tsx +54 -13
- package/src/components/chart/composite/event-captions.ts +109 -0
- package/src/components/chart/composite/event-guides.ts +74 -0
- package/src/components/chart/composite/rasterizer.ts +2 -0
- package/src/components/chart/composite/text-renderer.ts +2 -0
- package/src/components/chart/composite/types.ts +31 -0
- package/src/components/command-bar/layout-items/focused-pane.ts +5 -5
- package/src/components/command-bar/pane-settings.ts +2 -2
- package/src/components/command-bar/routes/root/provider-search.ts +5 -4
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/routes/ticker-search/results.ts +51 -0
- package/src/components/command-bar/routes/ticker-search/route.ts +3 -2
- package/src/components/input-search-bar.tsx +9 -2
- package/src/components/layout/detached-pane-shell.tsx +1 -1
- package/src/components/layout/floating-pane.tsx +5 -1
- package/src/components/layout/pane/footer/index.tsx +21 -14
- package/src/components/layout/pane/footer/model.ts +6 -0
- package/src/components/layout/pane/header.tsx +2 -0
- package/src/components/layout/shell/action-menu-overlay.tsx +10 -5
- package/src/components/layout/shell/active-drag.ts +149 -105
- package/src/components/layout/shell/drag/drop-zones.ts +162 -0
- package/src/components/layout/shell/drag/index.ts +47 -218
- package/src/components/layout/shell/drag/live.ts +10 -3
- package/src/components/layout/shell/drag/overlays.tsx +182 -5
- package/src/components/layout/shell/drag/runtime.ts +29 -6
- package/src/components/layout/shell/drag/shared-edges.ts +156 -0
- package/src/components/layout/shell/index.tsx +11 -6
- package/src/components/layout/shell/menu.ts +11 -2
- package/src/components/layout/shell/native/pointer-runtime.ts +25 -0
- package/src/components/layout/shell/native/window-state.ts +2 -2
- package/src/components/layout/shell/pane/capture.ts +4 -1
- package/src/components/layout/shell/pane/layers.tsx +71 -7
- package/src/components/layout/shell/terminal-pointer-runtime.ts +18 -9
- package/src/components/layout/shell/window-mode/index.ts +8 -10
- package/src/components/layout/status-bar.tsx +6 -1
- package/src/components/layout/window-edit/mode.ts +39 -7
- package/src/components/layout/window-edit/presentation.ts +1 -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 +20 -0
- package/src/components/onboarding/onboarding-wizard.tsx +16 -11
- 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/button.tsx +2 -0
- package/src/components/ui/choice-dialog.tsx +1 -0
- package/src/components/ui/data-table/index.tsx +4 -3
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/list-view.tsx +7 -12
- package/src/components/ui/loading.tsx +10 -3
- package/src/components/ui/menu.tsx +6 -2
- 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/quote.ts +14 -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/data/config/layout.ts +5 -2
- package/src/docs/snapshot.json +54 -13
- package/src/i18n/es.ts +9 -8
- package/src/i18n/ja.ts +9 -8
- package/src/i18n/ko.ts +9 -8
- package/src/i18n/zh-cn.ts +9 -8
- package/src/i18n/zh-tw.ts +9 -8
- package/src/layout/pane-manager/floating-actions.ts +17 -0
- package/src/layout/pane-manager/floating-stack.ts +187 -0
- package/src/layout/pane-manager/floating.ts +4 -2
- package/src/layout/pane-manager/gridlock.ts +5 -1
- package/src/layout/pane-manager/index.ts +11 -0
- package/src/layout/pane-manager/layout-state.ts +10 -3
- package/src/market-data/depositary-pair.ts +5 -3
- package/src/market-data/futures-board.ts +46 -1
- package/src/market-data/futures-contract.ts +12 -3
- package/src/market-data/fx-interventions.ts +270 -0
- package/src/market-data/market/dated-previous-close.ts +94 -15
- package/src/market-data/market/status.ts +17 -1
- package/src/news/news-model.ts +44 -2
- package/src/plugins/builtin/alerts/cli.ts +4 -4
- package/src/plugins/builtin/alerts/format.ts +1 -2
- package/src/plugins/builtin/alerts/headless.ts +1 -2
- package/src/plugins/builtin/alerts/move-checks.ts +12 -6
- package/src/plugins/builtin/alerts/move.ts +30 -9
- package/src/plugins/builtin/alerts/pane.tsx +0 -2
- package/src/plugins/builtin/alerts/storage.ts +4 -2
- package/src/plugins/builtin/alerts/types.ts +12 -0
- 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/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/changelog/index.tsx +292 -101
- package/src/plugins/builtin/changelog/versions.ts +293 -0
- package/src/plugins/builtin/chart-composer/headless.ts +2 -1
- package/src/plugins/builtin/chart-composer/index.tsx +1 -0
- package/src/plugins/builtin/chart-composer/intervention-events.ts +105 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +21 -7
- 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/render-state.ts +2 -5
- 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/attached-pane.tsx +10 -5
- package/src/plugins/builtin/cloud/askg/controller.ts +141 -5
- package/src/plugins/builtin/cloud/askg/executor.ts +113 -4
- package/src/plugins/builtin/cloud/askg/manifest.ts +28 -13
- package/src/plugins/builtin/cloud/askg/model.ts +14 -4
- package/src/plugins/builtin/cloud/askg/pane.tsx +70 -46
- package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
- package/src/plugins/builtin/cloud/askg/turn-parts.tsx +70 -0
- package/src/plugins/builtin/cloud/terminal-relay/engine.ts +50 -130
- package/src/plugins/builtin/cloud/terminal-relay/policy.ts +327 -7
- package/src/plugins/builtin/cloud/terminal-relay/prompts.tsx +2 -1
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +52 -9
- package/src/plugins/builtin/commodities-energy/index.tsx +1 -3
- package/src/plugins/builtin/commodities-energy/view-state.ts +3 -0
- 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/headless.ts +14 -2
- package/src/plugins/builtin/cot/index.tsx +1 -1
- package/src/plugins/builtin/cpi/index.tsx +1 -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/index.tsx +2 -2
- 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 +74 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
- package/src/plugins/builtin/econ/index.tsx +1 -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 +1 -0
- package/src/plugins/builtin/futures/index.tsx +25 -4
- package/src/plugins/builtin/futures/model.ts +28 -32
- package/src/plugins/builtin/futures/series.ts +4 -3
- package/src/plugins/builtin/futures/table.tsx +16 -9
- package/src/plugins/builtin/futures/use-board-terms.ts +3 -3
- 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/gpu/index.tsx +1 -1
- package/src/plugins/builtin/help/functions-table.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +14 -4
- package/src/plugins/builtin/help/keybindings-editor.tsx +19 -5
- 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/layout-manager/index.tsx +8 -8
- 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/headless.ts +2 -2
- package/src/plugins/builtin/news/index.tsx +4 -3
- 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/perps/markets-section.tsx +5 -2
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +11 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
- package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +3 -1
- package/src/plugins/builtin/power/index.tsx +1 -1
- package/src/plugins/builtin/realized-vol/index.tsx +1 -1
- package/src/plugins/builtin/research/event-model.ts +9 -1
- package/src/plugins/builtin/research/event-sources.ts +22 -0
- package/src/plugins/builtin/research/headless.ts +11 -5
- package/src/plugins/builtin/research/index.tsx +4 -0
- 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/cloud-upgrade.ts +27 -3
- 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/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/financials/model.ts +12 -0
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +5 -5
- package/src/plugins/builtin/ticker-detail/headless.ts +18 -13
- package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +54 -5
- package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +34 -17
- package/src/plugins/builtin/ticker-detail/pane.tsx +7 -2
- 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 +18 -3
- package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
- package/src/plugins/builtin/treasury-auctions/headless.ts +109 -19
- package/src/plugins/builtin/treasury-auctions/index.tsx +14 -4
- package/src/plugins/builtin/treasury-auctions/model.ts +256 -28
- package/src/plugins/builtin/treasury-auctions/pane.tsx +139 -28
- 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/plugins/installer.ts +45 -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 +56 -19
- package/src/remote/schema.ts +22 -9
- package/src/remote/secrets.ts +12 -0
- package/src/remote/semantic-helpers.ts +29 -1
- package/src/remote/semantic-tree.tsx +44 -15
- package/src/remote/server.ts +2 -1
- package/src/remote/surface.tsx +192 -0
- package/src/remote/types.ts +5 -0
- package/src/renderers/cloudflare/worker.ts +16 -1
- package/src/renderers/dom/styles.css +40 -6
- package/src/renderers/opentui/host.tsx +6 -0
- package/src/renderers/share/layout-view.tsx +1 -1
- 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 +37 -12
- package/src/state/opening-ticker-panes.ts +47 -0
- package/src/test-support/cli-context.ts +2 -0
- package/src/test-support/preload.ts +4 -1
- package/src/tickers/instrument-kind.ts +23 -3
- package/src/tickers/renamed-listings.ts +105 -0
- package/src/tickers/search/index.ts +103 -16
- package/src/time-series/resolve.ts +2 -2
- package/src/types/config.ts +5 -0
- package/src/types/context-menu.ts +2 -0
- package/src/types/financials.ts +1 -0
- package/src/types/plugin-commands.ts +140 -0
- package/src/types/plugin-context.ts +125 -0
- package/src/types/plugin-contributions.ts +55 -0
- package/src/types/plugin-definition.ts +234 -0
- package/src/types/plugin-notifications.ts +38 -0
- package/src/types/plugin-pane-settings.ts +116 -0
- package/src/types/plugin-pane-templates.ts +160 -0
- package/src/types/plugin-panes.ts +243 -0
- package/src/types/plugin-reports.ts +35 -0
- package/src/types/plugin-shared.ts +14 -0
- package/src/types/plugin-state.ts +71 -0
- package/src/types/plugin.ts +14 -1169
- package/src/ui/index.tsx +14 -3
- package/src/updater/github-releases.ts +23 -0
- package/src/utils/central-banks.ts +86 -1
- package/src/utils/cli-output.ts +22 -9
- package/src/utils/datetime-format.ts +12 -3
- package/src/utils/depositary-receipt.ts +28 -3
- package/src/utils/fundamentals.ts +14 -0
- package/src/utils/max-drawdown.ts +97 -16
- package/src/utils/untrusted-text.ts +29 -0
|
@@ -79,7 +79,6 @@ function useOnboardingWizard({ pluginRegistry, importBrokerPositions, onComplete
|
|
|
79
79
|
const rendererHost = useRendererHost();
|
|
80
80
|
const commandBarShortcut = useCommandBarShortcut();
|
|
81
81
|
const notificationActionShortcut = useActionShortcut("notification-action");
|
|
82
|
-
const notificationDismissShortcut = useActionShortcut("notification-dismiss");
|
|
83
82
|
const keybindings = useKeybindings();
|
|
84
83
|
const dialogOpen = useDialogState((dialog) => dialog.isOpen);
|
|
85
84
|
const commandBarOpen = useAppSelector((state) => state.commandBarOpen);
|
|
@@ -326,7 +325,7 @@ function useOnboardingWizard({ pluginRegistry, importBrokerPositions, onComplete
|
|
|
326
325
|
return {
|
|
327
326
|
coachAside,
|
|
328
327
|
coachKeysHidden: inputCaptured || typingInField,
|
|
329
|
-
helpFocused, stage, progress,
|
|
328
|
+
helpFocused, stage, progress, finish, notificationActionShortcut,
|
|
330
329
|
saveProgressInBackground, colors, commandBarShortcut, selectedBrokerId, brokerOptions, portfolioSub,
|
|
331
330
|
sectionAvailability, goToSection, skipSetup, isFinishing, isBrokerCommitting, desktop, positions,
|
|
332
331
|
inputRef, editingField, selectedPositionSymbol, brokerChoices, portfolioOptionIdx, setPortfolioOptionIdx,
|
|
@@ -379,7 +378,7 @@ function useCoachStepsAside(config: AppConfig, stage: OnboardingStage): boolean
|
|
|
379
378
|
export function OnboardingWizard(props: OnboardingWizardProps) {
|
|
380
379
|
const {
|
|
381
380
|
coachAside, coachKeysHidden,
|
|
382
|
-
helpFocused, stage, progress,
|
|
381
|
+
helpFocused, stage, progress, finish, notificationActionShortcut,
|
|
383
382
|
saveProgressInBackground, colors, commandBarShortcut, selectedBrokerId, brokerOptions, portfolioSub,
|
|
384
383
|
sectionAvailability, goToSection, skipSetup, isFinishing, isBrokerCommitting, desktop, positions,
|
|
385
384
|
inputRef, editingField, selectedPositionSymbol, brokerChoices, portfolioOptionIdx, setPortfolioOptionIdx,
|
|
@@ -401,15 +400,16 @@ export function OnboardingWizard(props: OnboardingWizardProps) {
|
|
|
401
400
|
title={tf("Built around {ticker}", { ticker })}
|
|
402
401
|
actions={<>
|
|
403
402
|
{/* Each button shows its key, as Connect shows Alt+Enter; in the
|
|
404
|
-
terminal the second wraps under the first
|
|
405
|
-
room for both:
|
|
406
|
-
|
|
403
|
+
terminal the second wraps under the first where the row is short.
|
|
404
|
+
The desktop card has no room for both: its dismiss key is in the
|
|
405
|
+
tooltip. Esc puts it away as it closes any card; the notification
|
|
406
|
+
dismiss key and F10 do too. In a field, or with a pane holding the
|
|
407
407
|
keyboard, the keys are the field's: the card shows none. */}
|
|
408
408
|
<OnboardingButton
|
|
409
409
|
label="Keep exploring"
|
|
410
410
|
variant="ghost"
|
|
411
|
-
shortcut={!desktop && !coachKeysHidden
|
|
412
|
-
title={desktop
|
|
411
|
+
shortcut={!desktop && !coachKeysHidden ? "Esc" : undefined}
|
|
412
|
+
title={desktop ? `${t("Keep exploring")} (Esc)` : undefined}
|
|
413
413
|
onPress={() => { void finish(); }}
|
|
414
414
|
/>
|
|
415
415
|
<OnboardingButton
|
|
@@ -419,9 +419,14 @@ export function OnboardingWizard(props: OnboardingWizardProps) {
|
|
|
419
419
|
onPress={() => saveProgressInBackground({ stage: "account" })}
|
|
420
420
|
/>
|
|
421
421
|
</>}>
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
422
|
+
{/* A skipped "What do you hold?" leaves no holdings to draw: the card names what is there. */}
|
|
423
|
+
<Text fg={colors.textDim} wrapText>{tf(progress.positionsImported === 0
|
|
424
|
+
? progress.desks?.length
|
|
425
|
+
? "A watchlist, the top news, and {ticker} charted. Your desks are tabs at the bottom; {shortcut} adds more."
|
|
426
|
+
: "A watchlist, the top news, and {ticker} charted. Every pane moves; {shortcut} adds more."
|
|
427
|
+
: progress.desks?.length
|
|
428
|
+
? "Your holdings as a heatmap, a watchlist, and {ticker} charted. Your desks are tabs at the bottom; {shortcut} adds more."
|
|
429
|
+
: "Your holdings as a heatmap, a watchlist, and {ticker} charted. Every pane moves; {shortcut} adds more.", {
|
|
425
430
|
ticker,
|
|
426
431
|
shortcut: commandBarShortcut,
|
|
427
432
|
})}</Text>
|
|
@@ -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
|
|
@@ -179,6 +179,8 @@ export function Button({
|
|
|
179
179
|
flexDirection="row"
|
|
180
180
|
backgroundColor={palette.bg}
|
|
181
181
|
cursor={inert ? "default" : "pointer"}
|
|
182
|
+
// The button is in the remote tree already, by its label and scope.
|
|
183
|
+
data-gloom-remote-hidden
|
|
182
184
|
onMouseDown={(event: { preventDefault?: () => void; stopPropagation?: () => void }) => {
|
|
183
185
|
if (stopPropagation) {
|
|
184
186
|
event.preventDefault?.();
|
|
@@ -109,6 +109,7 @@ export function ChoiceDialog({
|
|
|
109
109
|
selectedIndex={selectedIndex}
|
|
110
110
|
bgColor={bgColor ?? colors.bg}
|
|
111
111
|
emptyMessage={t("No choices.")}
|
|
112
|
+
remoteLabel={title}
|
|
112
113
|
rowGap={0}
|
|
113
114
|
surface="framed"
|
|
114
115
|
height={Math.min(Math.max(items.length, 1), MAX_VISIBLE_CHOICE_ROWS)}
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
DataTableProps,
|
|
7
7
|
} from "./types";
|
|
8
8
|
import { useRemoteUiNode } from "../../../remote/semantic-tree";
|
|
9
|
-
import { remoteNumberValue,
|
|
9
|
+
import { remoteNumberValue, resolveRemoteRowIndex } from "../../../remote/semantic-helpers";
|
|
10
10
|
import { useOptionalPaneInstanceId } from "../../../state/app/context";
|
|
11
11
|
import { registerPaneTableExporter } from "../../../state/pane-table-export-registry";
|
|
12
12
|
import { createDataTableCsv } from "../../data-table/export";
|
|
@@ -98,6 +98,8 @@ export function DataTable<T, C extends DataTableColumn = DataTableColumn>(
|
|
|
98
98
|
selectedId: firstSelectedId(props),
|
|
99
99
|
...(props.reportEveryRow ? { rows: cachedReportedRows(props, reportedRowsRef) } : {}),
|
|
100
100
|
}),
|
|
101
|
+
// Read for this table alone: a confirmation names the row a call would open.
|
|
102
|
+
getDetail: () => ({ rows: cachedReportedRows(props, reportedRowsRef) }),
|
|
101
103
|
});
|
|
102
104
|
// Header labels read the same in every table whatever case a pane wrote
|
|
103
105
|
// them in. Exports and automation keep the pane's own labels.
|
|
@@ -122,8 +124,7 @@ function resolveTableIndex<T, C extends DataTableColumn>(
|
|
|
122
124
|
props: DataTableProps<T, C>,
|
|
123
125
|
): number {
|
|
124
126
|
// `id` reads the same key the snapshot publishes as `selectedId`.
|
|
125
|
-
|
|
126
|
-
return resolveRemoteItemIndex(input, props.items, { id: key, key });
|
|
127
|
+
return resolveRemoteRowIndex(input, props.items, (item, index) => props.getItemKey(item, index));
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
/**
|
|
@@ -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";
|
|
@@ -4,8 +4,8 @@ import { useCallback, useEffect, useRef, useState, type ComponentType, type Reac
|
|
|
4
4
|
import { TextAttributes, type ScrollBoxRenderable } from "../../ui";
|
|
5
5
|
import { hoverBg } from "../../theme/colors";
|
|
6
6
|
import { t } from "../../i18n";
|
|
7
|
-
import { useRemoteUiNode } from "../../remote/semantic-tree";
|
|
8
|
-
import {
|
|
7
|
+
import { useRemoteUiNode, useRemoteUiScope } from "../../remote/semantic-tree";
|
|
8
|
+
import { resolveRemoteListIndex } from "../../remote/semantic-helpers";
|
|
9
9
|
import { observeScrollBoxContentSize, observeScrollBoxViewportSize } from "../../renderers/opentui/scrollbox-layout";
|
|
10
10
|
import { isPlainKey, type KeyboardModifierEventLike } from "../../utils/keyboard";
|
|
11
11
|
|
|
@@ -211,16 +211,18 @@ export function ListView({
|
|
|
211
211
|
remoteMetadata,
|
|
212
212
|
}: ListViewProps) {
|
|
213
213
|
const colors = useThemeColors();
|
|
214
|
+
// Drawn inside a prompt (a dialog that lists a prompt's answers), it carries the prompt's scope.
|
|
215
|
+
const contextScope = useRemoteUiScope();
|
|
214
216
|
useRemoteUiNode({
|
|
215
217
|
role: remoteRole,
|
|
216
218
|
label: remoteLabel ?? emptyMessage,
|
|
217
219
|
actions: {
|
|
218
220
|
select: (input) => {
|
|
219
|
-
const index =
|
|
221
|
+
const index = resolveRemoteListIndex(input, items);
|
|
220
222
|
if (index >= 0 && !items[index]?.disabled) onSelect?.(index);
|
|
221
223
|
},
|
|
222
224
|
activate: (input) => {
|
|
223
|
-
const index =
|
|
225
|
+
const index = resolveRemoteListIndex(input, items);
|
|
224
226
|
const item = index >= 0 ? items[index] : undefined;
|
|
225
227
|
if (item && !item.disabled) {
|
|
226
228
|
onSelect?.(index);
|
|
@@ -230,7 +232,7 @@ export function ListView({
|
|
|
230
232
|
},
|
|
231
233
|
metadata: {
|
|
232
234
|
...remoteMetadata,
|
|
233
|
-
scope: remoteScope,
|
|
235
|
+
scope: remoteScope ?? contextScope ?? undefined,
|
|
234
236
|
selectedIndex,
|
|
235
237
|
items: items.map((item, index) => ({
|
|
236
238
|
index,
|
|
@@ -394,10 +396,3 @@ export function ListView({
|
|
|
394
396
|
</Box>
|
|
395
397
|
);
|
|
396
398
|
}
|
|
397
|
-
|
|
398
|
-
function resolveListIndex(input: unknown, items: ListViewItem[]): number {
|
|
399
|
-
return resolveRemoteItemIndex(input, items, {
|
|
400
|
-
id: (item) => item.id,
|
|
401
|
-
label: (item) => item.label,
|
|
402
|
-
});
|
|
403
|
-
}
|
|
@@ -4,14 +4,21 @@ import { Box, SpinnerMark, Text } from "../../ui";
|
|
|
4
4
|
|
|
5
5
|
export interface SpinnerProps {
|
|
6
6
|
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The spinner and its label in the text colour rather than dim: a line that
|
|
9
|
+
* says what is happening now among text that is read (an answer coming
|
|
10
|
+
* in), where a dim one would pass for the metadata around it.
|
|
11
|
+
*/
|
|
12
|
+
emphasized?: boolean;
|
|
7
13
|
}
|
|
8
14
|
|
|
9
|
-
export function Spinner({ label }: SpinnerProps) {
|
|
15
|
+
export function Spinner({ label, emphasized = false }: SpinnerProps) {
|
|
10
16
|
const colors = useThemeColors();
|
|
17
|
+
const color = emphasized ? colors.text : colors.textDim;
|
|
11
18
|
return (
|
|
12
19
|
<Box flexDirection="row" gap={1} data-gloom-status="loading" data-gloom-ui="spinner">
|
|
13
|
-
<SpinnerMark name="dots" color={
|
|
14
|
-
{label && <Text fg={
|
|
20
|
+
<SpinnerMark name="dots" color={color} />
|
|
21
|
+
{label && <Text fg={color} wrapText>{t(label)}</Text>}
|
|
15
22
|
</Box>
|
|
16
23
|
);
|
|
17
24
|
}
|
|
@@ -3,7 +3,8 @@ import { Box, Text, TextAttributes, useUiHost, type HostMenuProps, type HostMenu
|
|
|
3
3
|
import { useThemeColors } from "../../theme/theme-context";
|
|
4
4
|
import { useShortcut } from "../../react/input";
|
|
5
5
|
import { keepEscapeFromClosing } from "../../utils/double-escape-close";
|
|
6
|
-
import { useRemoteUiNode } from "../../remote/semantic-tree";
|
|
6
|
+
import { useRemoteUiNode, useRemoteUiScope } from "../../remote/semantic-tree";
|
|
7
|
+
import { remoteMenuItemId } from "../../remote/semantic-helpers";
|
|
7
8
|
import { readsAtBodyContrast } from "../../theme/tone-contrast";
|
|
8
9
|
import { Popover } from "./popover";
|
|
9
10
|
|
|
@@ -19,12 +20,14 @@ export type MenuProps = HostMenuProps;
|
|
|
19
20
|
*/
|
|
20
21
|
export function Menu(props: MenuProps) {
|
|
21
22
|
const HostMenu = useUiHost().Menu as ComponentType<MenuProps> | undefined;
|
|
23
|
+
// A menu that lists a prompt's answers (a pane's Approve) carries the prompt's scope.
|
|
24
|
+
const scope = useRemoteUiScope();
|
|
22
25
|
useRemoteUiNode({
|
|
23
26
|
role: "menu",
|
|
24
27
|
label: props.label ?? props.title ?? "Menu",
|
|
25
28
|
actions: {
|
|
26
29
|
select: (input) => {
|
|
27
|
-
const id =
|
|
30
|
+
const id = remoteMenuItemId(input);
|
|
28
31
|
const item = props.items.find((entry) => entry.id === id && entry.kind !== "divider" && entry.kind !== "heading" && !entry.disabled);
|
|
29
32
|
if (item) props.onSelect(item.id);
|
|
30
33
|
},
|
|
@@ -32,6 +35,7 @@ export function Menu(props: MenuProps) {
|
|
|
32
35
|
metadata: {
|
|
33
36
|
selection: props.selection ?? "none",
|
|
34
37
|
items: props.items.filter((item) => item.kind !== "divider").map((item) => ({ id: item.id, label: item.label, selected: item.selected, checked: item.checked })),
|
|
38
|
+
...(scope ? { scope } : {}),
|
|
35
39
|
},
|
|
36
40
|
});
|
|
37
41
|
if (HostMenu) return <HostMenu {...props} />;
|
|
@@ -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,
|