gloomberb 0.20.11 → 0.20.13
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/src/account/billing.ts +3 -2
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/awards.ts +16 -0
- package/src/api-client/central-bank-rates.ts +5 -0
- package/src/api-client/data.ts +55 -2
- package/src/api-client/index.ts +28 -3
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/request.ts +86 -3
- package/src/api-client/socket-connection.ts +12 -1
- package/src/api-client/socket.ts +21 -3
- package/src/api-client/supply-chain-graph.ts +4 -2
- package/src/api-client/supply-chain.ts +8 -0
- package/src/api-client/telemetry.ts +47 -0
- package/src/api-client/types/econ.ts +10 -7
- package/src/api-client/types/filings-and-calls.ts +8 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/types/news.ts +16 -0
- package/src/app/global-shortcuts.ts +2 -1
- package/src/app/keybindings/actions.ts +19 -0
- package/src/app/pane-runtime/index.tsx +18 -3
- package/src/app/pane-runtime/layout-placement.ts +63 -0
- package/src/app/pane-runtime/ticker-open-runtime.ts +10 -2
- package/src/architecture/floating-promise-allowlist.json +17 -33
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/capabilities/chart-series.ts +4 -1
- package/src/cli/board-coins.ts +10 -1
- package/src/cli/commands/crypto-hints.ts +3 -2
- package/src/cli/commands/fred-series.ts +0 -54
- package/src/cli/commands/market.ts +260 -63
- package/src/cli/commands/overview.ts +50 -17
- package/src/cli/commands/search.ts +140 -17
- package/src/cli/commands/ticker.ts +37 -17
- package/src/cli/desktop-pane-shot.ts +27 -2
- package/src/cli/earnings-calendar.ts +33 -53
- package/src/cli/fx-quote-rate.ts +1 -1
- package/src/cli/glossary.ts +14 -5
- package/src/cli/history-catalog-series.ts +85 -0
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/index.ts +1 -1
- package/src/cli/known-gaps.ts +9 -0
- package/src/cli/list-progress.ts +45 -0
- package/src/cli/listing-arg.ts +176 -25
- package/src/cli/name-entries.ts +8 -4
- package/src/cli/not-a-ticker.ts +2 -2
- package/src/cli/pane-functions/catalog.ts +55 -7
- package/src/cli/pane-functions/dom.ts +8 -1
- package/src/cli/pane-functions/freshness.ts +52 -5
- package/src/cli/pane-functions/headless.ts +8 -8
- package/src/cli/pane-functions/index.ts +8 -5
- package/src/cli/pane-functions/market-session.ts +66 -14
- package/src/cli/pane-functions/options.ts +5 -0
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/pane-functions/resolver.ts +9 -2
- package/src/cli/pane-functions/screenshot-assessment.ts +28 -3
- package/src/cli/pane-functions/screenshot-types.ts +6 -0
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +55 -12
- package/src/cli/quote-list-reads.ts +87 -0
- package/src/cli/report-tables.ts +70 -13
- package/src/cli/result.ts +26 -3
- package/src/cli/symbol-list.ts +31 -4
- package/src/cli/terminal-code-hints.ts +83 -0
- package/src/cli/ticker-resolution.ts +2 -1
- package/src/cli/treasury-yields.ts +5 -0
- package/src/components/chart/composite/axis-overlays.tsx +5 -2
- package/src/components/chart/composite/composite-chart.tsx +1 -0
- package/src/components/chart/composite/format.ts +101 -15
- package/src/components/chart/composite/legend.tsx +60 -25
- package/src/components/chart/composite/time-axis.ts +51 -29
- package/src/components/chart/composite/toolbar.tsx +42 -6
- package/src/components/chart/curve/curve-surface.tsx +5 -5
- package/src/components/command-bar/action-runtime.ts +2 -0
- package/src/components/command-bar/list/badge.ts +8 -5
- package/src/components/command-bar/list/model.ts +0 -5
- package/src/components/command-bar/list/view.tsx +39 -2
- package/src/components/command-bar/routes/root/plugin-install.ts +4 -2
- package/src/components/command-bar/routes/root/provider-search.ts +23 -3
- package/src/components/command-bar/routes/root/results.ts +20 -9
- package/src/components/command-bar/routes/root/start-here.ts +1 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +2 -3
- package/src/components/command-bar/routes/ticker-search/results.ts +23 -4
- package/src/components/command-bar/routing/launch-request.ts +2 -1
- package/src/components/command-bar/routing/navigation-state.ts +4 -2
- package/src/components/command-bar/workflow/types.ts +6 -0
- package/src/components/data-table/view.tsx +29 -6
- package/src/components/form-modal/host.tsx +1 -1
- package/src/components/layout/detached-pane-shell.tsx +3 -0
- package/src/components/layout/double-escape-close.ts +34 -3
- package/src/components/layout/floating-pane.tsx +10 -4
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +3 -3
- package/src/components/layout/pane/cycle-order.ts +66 -2
- package/src/components/layout/pane/error-boundary.tsx +2 -1
- package/src/components/layout/pane/header.tsx +140 -31
- package/src/components/layout/pane/sidebar.tsx +13 -5
- package/src/components/layout/pane/status-footer.ts +3 -1
- package/src/components/layout/shell/drag/runtime.ts +5 -0
- package/src/components/layout/shell/index.tsx +25 -0
- package/src/components/layout/shell/menu.ts +9 -0
- package/src/components/layout/shell/pane/actions.ts +36 -0
- package/src/components/layout/shell/pane/management-shortcuts.ts +27 -3
- package/src/components/layout/shell/pane-occlusion.ts +40 -0
- package/src/components/layout/shell/shortcuts.ts +17 -1
- package/src/components/layout/shell/terminal-pointer-runtime.ts +39 -6
- package/src/components/layout/shell/window-mode/index.ts +5 -16
- package/src/components/layout/shell/window-mode/overlays.tsx +3 -1
- package/src/components/markdown-text.tsx +36 -0
- package/src/components/market-board/index.tsx +18 -8
- package/src/components/metric-treemap/index.tsx +3 -1
- package/src/components/onboarding/first-run-workspace.ts +46 -11
- package/src/components/onboarding/onboarding-keyboard.ts +57 -5
- package/src/components/onboarding/onboarding-wizard.tsx +91 -24
- package/src/components/onboarding/portfolio-step/index.tsx +1 -0
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +36 -9
- package/src/components/onboarding/portfolio-step/types.ts +2 -0
- package/src/components/onboarding/tickers-step-model.ts +140 -0
- package/src/components/onboarding/tickers-step.tsx +116 -0
- package/src/components/onboarding/use-onboarding-broker-form.ts +1 -1
- package/src/components/onboarding/use-onboarding-progress.ts +100 -11
- package/src/components/onboarding/use-onboarding-upgrade.ts +3 -2
- package/src/components/onboarding/wizard-model.ts +3 -1
- package/src/components/onboarding/wizard-tickers.ts +139 -0
- package/src/components/price-performance.tsx +2 -2
- package/src/components/speedometer-gauge/model.ts +2 -1
- package/src/components/speedometer-gauge/terminal.tsx +13 -8
- package/src/components/ui/button.tsx +48 -4
- package/src/components/ui/choice-dialog.tsx +101 -32
- package/src/components/ui/data-table/opentui/index.tsx +24 -9
- package/src/components/ui/data-table/types.ts +7 -0
- package/src/components/ui/inline-quick-add.tsx +19 -3
- package/src/components/ui/list-view.tsx +11 -5
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/query-bar.tsx +32 -5
- package/src/components/ui/selection-fill.ts +39 -0
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/core/state/app/layout-reducer.ts +2 -1
- package/src/core/state/app/pane-choices.ts +68 -0
- package/src/core/state/app/state.ts +14 -6
- package/src/core/state/app/types.ts +8 -0
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +1 -1
- package/src/i18n/es.ts +5 -2
- package/src/i18n/ja.ts +5 -2
- package/src/i18n/ko.ts +5 -2
- package/src/i18n/zh-cn.ts +5 -2
- package/src/i18n/zh-tw.ts +5 -2
- package/src/layout/pane-manager/dock-tree.ts +19 -0
- package/src/layout/pane-manager/index.ts +3 -0
- package/src/layout-marketplace/model.ts +2 -1
- package/src/market-data/futures-contract.ts +2 -1
- package/src/market-data/hooks.tsx +1 -1
- package/src/market-data/market/change-basis.ts +27 -5
- package/src/market-data/market/format.ts +13 -13
- package/src/market-data/market/freshness.ts +33 -0
- package/src/market-data/market/status.ts +5 -1
- package/src/market-data/quotes/contributions.ts +10 -0
- package/src/market-data/quotes/freshness.ts +19 -0
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/live-valuation.ts +31 -4
- package/src/market-data/quotes/resolution.ts +4 -0
- package/src/market-data/quotes/time.ts +17 -24
- package/src/market-data/tax-equivalent.ts +3 -2
- package/src/news/aggregator.ts +19 -8
- package/src/news/hooks.ts +1 -1
- package/src/news/news-model.ts +49 -0
- package/src/news/types.ts +9 -0
- package/src/plugins/builtin/account-management/calendar-tab.tsx +8 -3
- package/src/plugins/builtin/account-management/index.tsx +1 -0
- package/src/plugins/builtin/account-management/pane.tsx +9 -8
- package/src/plugins/builtin/alerts/calendar-events.ts +4 -5
- package/src/plugins/builtin/alerts/format.ts +6 -5
- package/src/plugins/builtin/alerts/headless.ts +3 -2
- package/src/plugins/builtin/alerts/history.ts +2 -1
- package/src/plugins/builtin/alerts/pane.tsx +2 -1
- package/src/plugins/builtin/alerts/price-text.ts +2 -1
- package/src/plugins/builtin/alerts/scheduled.ts +6 -5
- package/src/plugins/builtin/analytics/account-returns.ts +6 -7
- package/src/plugins/builtin/analytics/display.ts +2 -1
- package/src/plugins/builtin/analytics/pane-model.ts +5 -9
- package/src/plugins/builtin/analytics/risk-model.ts +6 -6
- package/src/plugins/builtin/analytics/risk-pane.tsx +6 -5
- package/src/plugins/builtin/analytics/view.tsx +5 -5
- package/src/plugins/builtin/attention/model.ts +6 -5
- package/src/plugins/builtin/attention/pane.tsx +5 -4
- package/src/plugins/builtin/awards/detail.tsx +17 -8
- package/src/plugins/builtin/awards/headless.ts +37 -15
- package/src/plugins/builtin/awards/model.ts +40 -5
- package/src/plugins/builtin/awards/pane.tsx +11 -8
- package/src/plugins/builtin/backtest/format.ts +3 -2
- package/src/plugins/builtin/backtest/report.ts +3 -2
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/add-flow.tsx +1 -1
- package/src/plugins/builtin/broker-manager/index.tsx +1 -0
- package/src/plugins/builtin/broker-trading/index.tsx +1 -1
- package/src/plugins/builtin/broker-trading/orders-data.ts +3 -3
- package/src/plugins/builtin/broker-trading/orders.tsx +3 -2
- package/src/plugins/builtin/broker-trading/ticket.tsx +2 -2
- package/src/plugins/builtin/buildout/cells.tsx +2 -1
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -3
- package/src/plugins/builtin/buildout/data-runtime.ts +21 -23
- package/src/plugins/builtin/buildout/detail/values.ts +2 -1
- package/src/plugins/builtin/buildout/format.ts +4 -3
- package/src/plugins/builtin/buildout/pane/index.tsx +3 -3
- package/src/plugins/builtin/catalysts/detail.tsx +2 -1
- package/src/plugins/builtin/catalysts/model.ts +6 -5
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +3 -2
- package/src/plugins/builtin/cds/model.ts +8 -8
- package/src/plugins/builtin/cds/pane.tsx +3 -2
- package/src/plugins/builtin/central-bank-rates/headless.ts +8 -7
- package/src/plugins/builtin/central-bank-rates/index.tsx +1 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +24 -5
- package/src/plugins/builtin/central-bank-rates/pane.tsx +19 -9
- package/src/plugins/builtin/changelog/index.tsx +2 -2
- package/src/plugins/builtin/chart-composer/headless.ts +5 -1
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +8 -3
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +3 -1
- package/src/plugins/builtin/chart-composer/user-series.ts +3 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +2 -1
- package/src/plugins/builtin/chat/content/handle-prompt.tsx +4 -0
- package/src/plugins/builtin/chat/controller/realtime.ts +17 -1
- package/src/plugins/builtin/chat/controller/utils.ts +2 -1
- package/src/plugins/builtin/chat/message/terminal.tsx +4 -1
- package/src/plugins/builtin/chat/sidebar.tsx +3 -4
- package/src/plugins/builtin/clinical-trials/model.ts +4 -3
- package/src/plugins/builtin/clinical-trials/sponsor-tickers.ts +4 -2
- package/src/plugins/builtin/cloud/askg/lock-note.ts +16 -4
- package/src/plugins/builtin/cloud/askg/model.ts +2 -1
- package/src/plugins/builtin/cloud/askg/pane.tsx +39 -1
- package/src/plugins/builtin/cloud/company-picker.tsx +1 -3
- package/src/plugins/builtin/cloud/plugin.tsx +1 -0
- package/src/plugins/builtin/cloud/team/module.tsx +1 -0
- package/src/plugins/builtin/cloud/team/pane.tsx +12 -12
- package/src/plugins/builtin/cloud/thesis/detail.tsx +22 -12
- package/src/plugins/builtin/cloud-tweets/model.ts +2 -2
- package/src/plugins/builtin/comment-letters/pane.tsx +2 -1
- package/src/plugins/builtin/commodity-balances/headless.ts +3 -2
- package/src/plugins/builtin/commodity-balances/pane.tsx +13 -5
- package/src/plugins/builtin/company-attention/app-rank.tsx +5 -4
- package/src/plugins/builtin/company-attention/building-model.ts +7 -7
- package/src/plugins/builtin/company-attention/headless.ts +6 -5
- package/src/plugins/builtin/company-attention/model.ts +4 -4
- package/src/plugins/builtin/company-attention/moves-model.ts +9 -9
- package/src/plugins/builtin/company-attention/signals-model.ts +9 -9
- package/src/plugins/builtin/company-kpis/headless.ts +2 -1
- package/src/plugins/builtin/company-kpis/model.ts +18 -13
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -2
- package/src/plugins/builtin/congress-trades/detail.tsx +6 -5
- package/src/plugins/builtin/congress-trades/headless.ts +2 -1
- package/src/plugins/builtin/congress-trades/model.ts +6 -6
- package/src/plugins/builtin/congress-trades/table.tsx +7 -6
- package/src/plugins/builtin/connections/index.ts +1 -0
- package/src/plugins/builtin/connections/pane.tsx +5 -5
- package/src/plugins/builtin/correlation/headless.ts +2 -2
- package/src/plugins/builtin/correlation/index.tsx +4 -1
- package/src/plugins/builtin/correlation/matrix/selection.ts +2 -1
- package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -3
- package/src/plugins/builtin/cot/headless.ts +3 -2
- package/src/plugins/builtin/cot/model.ts +2 -1
- package/src/plugins/builtin/cot/pane.tsx +4 -3
- package/src/plugins/builtin/cpi/headless.ts +4 -3
- package/src/plugins/builtin/cpi/model.ts +8 -7
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +14 -9
- package/src/plugins/builtin/credit-boards/client.ts +5 -0
- package/src/plugins/builtin/credit-boards/headless.ts +3 -7
- package/src/plugins/builtin/credit-boards/model.ts +5 -11
- package/src/plugins/builtin/credit-boards/series.ts +19 -8
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +9 -5
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/index.tsx +2 -2
- package/src/plugins/builtin/credit-documents/model.ts +2 -2
- package/src/plugins/builtin/crypto-board/defi-view.tsx +7 -7
- package/src/plugins/builtin/crypto-board/defi.ts +2 -2
- package/src/plugins/builtin/crypto-board/model.ts +4 -3
- package/src/plugins/builtin/crypto-board/pane.tsx +8 -8
- package/src/plugins/builtin/crypto-board/supply.ts +2 -2
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +23 -13
- package/src/plugins/builtin/crypto-etf-flows/model.ts +4 -4
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +8 -3
- package/src/plugins/builtin/custom-view/index.tsx +3 -1
- package/src/plugins/builtin/custom-view/pane.tsx +5 -1
- package/src/plugins/builtin/custom-view/view-spec.ts +11 -0
- package/src/plugins/builtin/debt-maturities/headless.ts +16 -7
- package/src/plugins/builtin/debt-maturities/model.ts +12 -18
- package/src/plugins/builtin/debt-maturities/pane.tsx +11 -12
- package/src/plugins/builtin/dividend-yield/client.ts +7 -3
- package/src/plugins/builtin/dividend-yield/headless.ts +16 -11
- package/src/plugins/builtin/dividend-yield/pane.tsx +12 -10
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +4 -1
- package/src/plugins/builtin/dividend-yield/ranking.ts +19 -11
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +3 -3
- package/src/plugins/builtin/docs/use-docs.ts +4 -2
- package/src/plugins/builtin/doe/headless.ts +2 -1
- package/src/plugins/builtin/doe/model.ts +12 -11
- package/src/plugins/builtin/earnings/board-model.ts +42 -7
- package/src/plugins/builtin/earnings/board-table.ts +13 -8
- package/src/plugins/builtin/earnings/board.tsx +15 -3
- package/src/plugins/builtin/earnings/calendar-model.ts +5 -5
- package/src/plugins/builtin/earnings/calendar.tsx +11 -6
- package/src/plugins/builtin/earnings/client.ts +0 -9
- package/src/plugins/builtin/earnings/format.ts +16 -14
- package/src/plugins/builtin/earnings/headless.ts +64 -23
- package/src/plugins/builtin/earnings/history-model.ts +11 -7
- package/src/plugins/builtin/earnings/history-table.ts +14 -9
- package/src/plugins/builtin/earnings/history.tsx +22 -14
- package/src/plugins/builtin/earnings-calls/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings-calls/data.ts +24 -4
- package/src/plugins/builtin/earnings-calls/format.ts +29 -10
- package/src/plugins/builtin/earnings-calls/headless.ts +23 -3
- package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
- package/src/plugins/builtin/earnings-calls/model.ts +11 -1
- package/src/plugins/builtin/earnings-calls/pane.tsx +2 -5
- package/src/plugins/builtin/earnings-calls/upcoming.ts +5 -5
- package/src/plugins/builtin/earnings-ripple/headless.ts +2 -1
- package/src/plugins/builtin/earnings-ripple/model.ts +3 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +6 -6
- package/src/plugins/builtin/econ/calendar-model.ts +29 -2
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -0
- package/src/plugins/builtin/econ/index.tsx +16 -8
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -1
- package/src/plugins/builtin/econ-statistics/headless.ts +7 -5
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
- package/src/plugins/builtin/econ-statistics/pane.tsx +2 -2
- package/src/plugins/builtin/equity-screener/headless.ts +5 -5
- package/src/plugins/builtin/equity-screener/model.ts +6 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +7 -7
- package/src/plugins/builtin/equity-screener/screen-check.ts +2 -1
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
- package/src/plugins/builtin/estimate-revisions/model.ts +3 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +8 -8
- package/src/plugins/builtin/executives/format.ts +4 -4
- package/src/plugins/builtin/exposure/headless.ts +8 -8
- package/src/plugins/builtin/exposure/model.ts +4 -3
- package/src/plugins/builtin/exposure/pane.tsx +6 -5
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/headless.ts +18 -14
- package/src/plugins/builtin/fear-greed/pane.tsx +12 -4
- package/src/plugins/builtin/filing-events/feed.ts +2 -1
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/futures/table.tsx +8 -8
- package/src/plugins/builtin/futures-curve/headless.ts +18 -18
- package/src/plugins/builtin/futures-curve/model.ts +5 -5
- package/src/plugins/builtin/futures-curve/pane.tsx +8 -8
- package/src/plugins/builtin/fx-matrix/index.tsx +32 -21
- package/src/plugins/builtin/fx-matrix/pairs.ts +2 -1
- package/src/plugins/builtin/gpu/board.tsx +6 -5
- package/src/plugins/builtin/gpu/changes.tsx +2 -1
- package/src/plugins/builtin/gpu/equities.tsx +2 -2
- package/src/plugins/builtin/gpu/headless.ts +4 -3
- package/src/plugins/builtin/gpu/model.ts +8 -7
- package/src/plugins/builtin/help/functions-table.tsx +41 -9
- package/src/plugins/builtin/help/index.tsx +6 -3
- package/src/plugins/builtin/help/keybindings-editor.tsx +35 -7
- package/src/plugins/builtin/help/shortcut-table.tsx +19 -7
- package/src/plugins/builtin/help/table-cells.tsx +51 -0
- package/src/plugins/builtin/holders/pane.tsx +4 -1
- package/src/plugins/builtin/insider/base-values.ts +2 -2
- package/src/plugins/builtin/insider/display.ts +2 -1
- package/src/plugins/builtin/insider/headless.ts +16 -16
- package/src/plugins/builtin/insider/insider-data.ts +2 -1
- package/src/plugins/builtin/insider/signals-model.ts +3 -3
- package/src/plugins/builtin/insider/table-model.ts +27 -13
- package/src/plugins/builtin/insider/table.tsx +11 -8
- package/src/plugins/builtin/insider/tickers.tsx +1 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +4 -4
- package/src/plugins/builtin/iv-history/format.ts +8 -7
- package/src/plugins/builtin/iv-history/headless.ts +18 -16
- package/src/plugins/builtin/iv-history/pane.tsx +3 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +5 -4
- package/src/plugins/builtin/jobs/headless.ts +11 -11
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/jobs/model.ts +2 -2
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/jodi/model.ts +2 -2
- package/src/plugins/builtin/jodi/pane.tsx +2 -1
- package/src/plugins/builtin/kelly-sizer/headless.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/model.ts +2 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -2
- package/src/plugins/builtin/macro-day/headless.ts +9 -8
- package/src/plugins/builtin/macro-day/model.ts +3 -2
- package/src/plugins/builtin/macro-day/pane.tsx +4 -4
- package/src/plugins/builtin/macro-day/releases.ts +25 -16
- package/src/plugins/builtin/market-halts/model.ts +11 -10
- package/src/plugins/builtin/market-halts/pane.tsx +2 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +4 -4
- package/src/plugins/builtin/market-movers/index.tsx +20 -8
- package/src/plugins/builtin/market-movers/model.ts +5 -0
- package/src/plugins/builtin/market-movers/session-body.tsx +2 -1
- package/src/plugins/builtin/market-movers/session-table.ts +3 -3
- package/src/plugins/builtin/market-movers/session.ts +2 -1
- package/src/plugins/builtin/market-movers/table.ts +5 -5
- package/src/plugins/builtin/market-valuation/detail.tsx +2 -2
- package/src/plugins/builtin/market-valuation/headless.ts +7 -7
- package/src/plugins/builtin/market-valuation/pane.tsx +7 -7
- package/src/plugins/builtin/members/breadth-pane.tsx +5 -4
- package/src/plugins/builtin/members/headless.ts +2 -1
- package/src/plugins/builtin/members/model.ts +3 -2
- package/src/plugins/builtin/members/pane.tsx +10 -9
- package/src/plugins/builtin/mna/distress/model.ts +2 -1
- package/src/plugins/builtin/mna/model.ts +5 -5
- package/src/plugins/builtin/money-markets/headless.ts +14 -3
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +14 -5
- package/src/plugins/builtin/news/headless.ts +5 -2
- package/src/plugins/builtin/news/wire/breaking/notifications.ts +21 -19
- package/src/plugins/builtin/news/wire/news/row.ts +3 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +3 -2
- package/src/plugins/builtin/news/wire/persisted-articles.ts +28 -3
- package/src/plugins/builtin/notes/headless.ts +2 -1
- package/src/plugins/builtin/notes/model.ts +2 -1
- package/src/plugins/builtin/openfda/pane.tsx +4 -3
- package/src/plugins/builtin/options/carry.ts +3 -2
- package/src/plugins/builtin/options/market-reference.ts +2 -1
- package/src/plugins/builtin/options/table.ts +48 -9
- package/src/plugins/builtin/options/view.tsx +48 -17
- package/src/plugins/builtin/options-calculator/headless.ts +3 -2
- package/src/plugins/builtin/options-calculator/pane.tsx +7 -7
- package/src/plugins/builtin/options-positioning/headless.ts +8 -7
- package/src/plugins/builtin/options-positioning/model.ts +10 -10
- package/src/plugins/builtin/options-positioning/pane.tsx +6 -6
- package/src/plugins/builtin/options-scenario/collar.ts +5 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +11 -10
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +15 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +2 -1
- package/src/plugins/builtin/options-scenario/csp.ts +6 -5
- package/src/plugins/builtin/options-scenario/headless.ts +6 -5
- package/src/plugins/builtin/options-scenario/hedge.ts +3 -3
- package/src/plugins/builtin/options-scenario/pane.tsx +7 -6
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +1 -1
- package/src/plugins/builtin/pe-band/headless.ts +9 -8
- package/src/plugins/builtin/pe-band/pane.tsx +7 -7
- package/src/plugins/builtin/perps/cascade.ts +3 -2
- package/src/plugins/builtin/perps/headless.ts +10 -9
- package/src/plugins/builtin/perps/model.ts +14 -14
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -31
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/index.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/pane/futures-terms.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +6 -1
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +2 -1
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +24 -10
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +9 -11
- package/src/plugins/builtin/portfolio-list/table.tsx +10 -1
- package/src/plugins/builtin/power/detail.tsx +6 -5
- package/src/plugins/builtin/power/gas-model.ts +8 -7
- package/src/plugins/builtin/power/gas.tsx +2 -1
- package/src/plugins/builtin/power/headless.ts +7 -6
- package/src/plugins/builtin/power/model.ts +3 -2
- package/src/plugins/builtin/power/prices-headless.ts +10 -9
- package/src/plugins/builtin/power/prices-model.ts +3 -2
- package/src/plugins/builtin/power/prices.tsx +2 -1
- package/src/plugins/builtin/primary-dealers/model.ts +3 -3
- package/src/plugins/builtin/primary-dealers/pane.tsx +2 -2
- package/src/plugins/builtin/rate-path/headless.ts +8 -7
- package/src/plugins/builtin/rate-path/model.ts +6 -5
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +2 -1
- package/src/plugins/builtin/realized-vol/headless.ts +37 -10
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/relative-rotation/pane.tsx +6 -6
- package/src/plugins/builtin/research/analyst-headless.ts +5 -5
- package/src/plugins/builtin/research/analyst-model.ts +7 -7
- package/src/plugins/builtin/research/analyst-pane.tsx +7 -7
- package/src/plugins/builtin/research/client.ts +14 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +40 -30
- package/src/plugins/builtin/research/event-model.ts +55 -22
- package/src/plugins/builtin/research/event-sources.ts +26 -8
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -12
- package/src/plugins/builtin/research/relative-valuation-currency.ts +16 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +33 -21
- package/src/plugins/builtin/research/relative-valuation-model.ts +31 -17
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +29 -14
- package/src/plugins/builtin/research-search/model.ts +2 -1
- package/src/plugins/builtin/research-search/saved-view.tsx +4 -3
- package/src/plugins/builtin/revenue-breakdown/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +7 -7
- package/src/plugins/builtin/reverse-dcf/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -2
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- package/src/plugins/builtin/scanner/flow-model.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/headless.ts +3 -2
- package/src/plugins/builtin/scanner/hilo-model.ts +2 -1
- package/src/plugins/builtin/scanner/live-headless.ts +2 -2
- package/src/plugins/builtin/scanner/live-model.ts +3 -2
- package/src/plugins/builtin/scanner/live-pane.tsx +5 -5
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/seasonality/pane.tsx +4 -3
- package/src/plugins/builtin/sec/filing-display.tsx +12 -15
- package/src/plugins/builtin/sec/fund-facts.ts +2 -2
- package/src/plugins/builtin/sec/headless.ts +2 -1
- package/src/plugins/builtin/sec/index.tsx +6 -2
- package/src/plugins/builtin/sectors/headless.ts +4 -4
- package/src/plugins/builtin/sectors/index.tsx +7 -7
- package/src/plugins/builtin/shared/earnings-calendar.ts +90 -6
- package/src/plugins/builtin/shared/earnings-report.ts +13 -6
- package/src/plugins/builtin/shared/research-cells.tsx +2 -2
- package/src/plugins/builtin/shared/source-footer.ts +71 -0
- package/src/plugins/builtin/shared/trend.ts +2 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +9 -8
- package/src/plugins/builtin/short-interest/headless.ts +6 -6
- package/src/plugins/builtin/short-interest/model.ts +9 -9
- package/src/plugins/builtin/short-interest/publications-model.ts +5 -5
- package/src/plugins/builtin/short-interest/publications-pane.tsx +8 -3
- package/src/plugins/builtin/short-interest/watch-headless.ts +5 -5
- package/src/plugins/builtin/short-interest/watch-pane.tsx +6 -6
- package/src/plugins/builtin/short-volume/model.ts +5 -5
- package/src/plugins/builtin/short-volume/pane.tsx +9 -5
- package/src/plugins/builtin/social-mentions/headless.ts +2 -1
- package/src/plugins/builtin/social-mentions/model.ts +4 -4
- package/src/plugins/builtin/social-mentions/outliers.tsx +10 -1
- package/src/plugins/builtin/social-mentions/pane.tsx +7 -0
- package/src/plugins/builtin/supply-chain/client.ts +3 -1
- package/src/plugins/builtin/supply-chain/flow.tsx +25 -8
- package/src/plugins/builtin/supply-chain/graph-client.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-evidence.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-model.ts +14 -2
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +11 -10
- package/src/plugins/builtin/supply-chain/graph.tsx +12 -6
- package/src/plugins/builtin/supply-chain/headless.ts +15 -8
- package/src/plugins/builtin/supply-chain/model.ts +72 -15
- package/src/plugins/builtin/supply-chain/pane.tsx +11 -8
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +7 -6
- package/src/plugins/builtin/themes/headless.ts +2 -1
- package/src/plugins/builtin/themes/model.ts +3 -2
- package/src/plugins/builtin/themes/pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/format.ts +9 -9
- package/src/plugins/builtin/thirteenf/headless.ts +3 -2
- package/src/plugins/builtin/thirteenf/model.ts +2 -1
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +2 -1
- package/src/plugins/builtin/thirteenf/pane.tsx +5 -4
- package/src/plugins/builtin/thirteenf/report-notes.ts +2 -1
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/table.ts +6 -5
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -3
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/model.ts +83 -35
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -1
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +2 -2
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +14 -18
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +8 -13
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -5
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +18 -5
- package/src/plugins/builtin/ticker-detail/overview/model.ts +24 -13
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +6 -0
- package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +2 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +35 -7
- package/src/plugins/builtin/ticker-detail/pane.tsx +48 -24
- package/src/plugins/builtin/ticker-detail/quote-footer.ts +5 -0
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +13 -8
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +4 -4
- package/src/plugins/builtin/ticker-detail/settings.ts +17 -0
- package/src/plugins/builtin/time-sales/headless.ts +3 -2
- package/src/plugins/builtin/time-sales/model.ts +7 -5
- package/src/plugins/builtin/time-sales/pane.tsx +7 -6
- package/src/plugins/builtin/trace-bonds/model.ts +3 -2
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/after.ts +50 -23
- package/src/plugins/builtin/treasury-auctions/cache.ts +23 -5
- package/src/plugins/builtin/treasury-auctions/client.ts +2 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +231 -42
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +14 -7
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +37 -34
- package/src/plugins/builtin/treasury-auctions/hk.ts +65 -13
- package/src/plugins/builtin/treasury-auctions/index.tsx +3 -0
- package/src/plugins/builtin/treasury-auctions/keys.ts +27 -0
- package/src/plugins/builtin/treasury-auctions/like.ts +137 -0
- package/src/plugins/builtin/treasury-auctions/model.ts +101 -23
- package/src/plugins/builtin/treasury-auctions/pane.tsx +56 -28
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -1
- package/src/plugins/builtin/treasury-daily/model.ts +2 -2
- package/src/plugins/builtin/vol-surface/events.ts +5 -4
- package/src/plugins/builtin/vol-surface/headless.ts +19 -18
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +6 -3
- package/src/plugins/builtin/vol-surface/pane.tsx +13 -9
- package/src/plugins/builtin/vol-surface/stored.ts +2 -1
- package/src/plugins/builtin/vol-surface/tables.ts +4 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -4
- package/src/plugins/builtin/volatility/pane.tsx +6 -6
- package/src/plugins/builtin/world-indices/headless.ts +7 -7
- package/src/plugins/builtin/world-indices/index.tsx +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +2 -1
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +2 -1
- package/src/plugins/builtin/world-venue-map/layers.ts +3 -2
- package/src/plugins/builtin/world-venue-map/use-geo.ts +4 -2
- package/src/plugins/builtin/yield-curve/curves.ts +3 -3
- package/src/plugins/builtin/yield-curve/headless.ts +7 -6
- package/src/plugins/builtin/yield-curve/index.tsx +5 -4
- package/src/plugins/builtin/yield-curve/swaps.tsx +2 -1
- package/src/plugins/runtime/index.tsx +1 -0
- package/src/plugins/runtime/state.ts +20 -0
- package/src/portfolio/allocation.ts +5 -5
- package/src/portfolio/column-values.ts +54 -42
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
- package/src/public/react.ts +7 -0
- package/src/react/auto-refresh.ts +29 -0
- package/src/renderers/browser/deeplink-bridge.ts +24 -3
- package/src/renderers/dom/desktop/query-bar.tsx +229 -60
- package/src/renderers/dom/host/overflow-fade-px.ts +2 -0
- package/src/renderers/dom/host/overflow-fade.ts +1 -2
- package/src/renderers/dom/styles.css +25 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +2 -1
- package/src/renderers/opentui/ui-host.tsx +32 -2
- package/src/renderers/share/layout-view.tsx +2 -1
- package/src/series/types.ts +2 -0
- package/src/sources/gloomberb-cloud/fred-attribution.ts +86 -0
- package/src/sources/gloomberb-cloud/index.ts +25 -1
- package/src/sources/gloomberb-cloud/news.ts +9 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +24 -3
- package/src/sources/provider-errors.ts +64 -1
- package/src/sources/provider-router/batches.ts +19 -0
- package/src/sources/provider-router/index.ts +7 -1
- package/src/sources/provider-router/search.ts +15 -10
- package/src/state/app/context/index.tsx +24 -1
- package/src/state/hooks/inline-tickers.ts +3 -2
- package/src/state/hooks/quote-streaming.ts +9 -10
- package/src/state/pane-unsent-work.ts +47 -0
- package/src/team/collections-sync.ts +8 -3
- package/src/telemetry/usage-counts.ts +26 -0
- package/src/test-support/shell-pane-keys.tsx +5 -0
- package/src/test-support/telemetry-guard.ts +83 -0
- package/src/test-support/test-env.ts +12 -0
- package/src/theme/colors.ts +17 -1
- package/src/theme/ui-tokens.ts +50 -1
- package/src/tickers/company-name-listing.ts +2 -2
- package/src/tickers/company-name.ts +17 -1
- package/src/tickers/listing-venues.ts +37 -2
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/index.ts +19 -0
- package/src/tickers/search/japanese-names.json +1 -0
- package/src/tickers/search/japanese-names.ts +152 -0
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/tickers/terminal-codes.ts +55 -6
- package/src/time-series/base-series.ts +3 -0
- package/src/time-series/fundamentals/statement-fields.ts +11 -14
- package/src/time-series/history-acquisition.ts +1 -1
- package/src/time-series/log-scale.ts +9 -0
- package/src/time-series/reporting.ts +3 -3
- package/src/time-series/resolve.ts +6 -4
- package/src/time-series/transforms.ts +10 -5
- package/src/types/config.ts +9 -0
- package/src/types/data-provider.ts +9 -2
- package/src/types/financials.ts +26 -0
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-contributions.ts +7 -0
- package/src/types/plugin-panes.ts +8 -1
- package/src/types/plugin-reports.ts +8 -0
- package/src/ui/host.tsx +6 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/double-escape-close.ts +42 -0
- package/src/utils/financial-statements.ts +39 -15
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/fx-status.ts +30 -7
- package/src/utils/growth.ts +67 -0
- package/src/utils/keyboard.ts +6 -0
- package/src/utils/network-failure.ts +23 -0
- package/src/utils/options.ts +1 -1
- package/src/utils/report-timing.ts +2 -2
- package/src/utils/served-rates.ts +45 -0
- package/src/utils/text-wrap.ts +84 -3
- package/src/utils/zoned-date-time.ts +47 -22
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { useMemo, useRef } from "react";
|
|
2
3
|
import type { AwardRow } from "../../../api-client/awards";
|
|
3
4
|
import { ActionRow, KeyValueRow, PaneStatusBody, Section, StatGrid, usePagedRows, usePaneNoticeFooter, usePaneStatusFooter, useTableLoadMore } from "../../../components";
|
|
@@ -5,14 +6,16 @@ import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
|
5
6
|
import { useThemeColors } from "../../../theme/theme-context";
|
|
6
7
|
import { Box, ScrollBox, Text, useRendererHost, useUiCapabilities, type ScrollBoxRenderable } from "../../../ui";
|
|
7
8
|
import { fetchAward, loadAward } from "./client";
|
|
8
|
-
import { awardPeriod, awardTypeLabel, money } from "./model";
|
|
9
|
+
import { amountWithheld, awardPeriod, awardTypeLabel, money, statementText, WITHHELD_AMOUNT } from "./model";
|
|
9
10
|
import { UpgradeLabel } from "../shared/locked-rows";
|
|
10
11
|
|
|
11
|
-
export function AwardDetail({ row, accessKey, width, height, focused, openAward, openChildren, openUpgrade, attribution }: {
|
|
12
|
+
export function AwardDetail({ row, accessKey, width, height, focused, openAward, openChildren, openUpgrade, attribution: boardAttribution, amountNotice: boardAmountNotice }: {
|
|
12
13
|
row: AwardRow; accessKey: string; width: number; height: number; focused: boolean; openAward: (id: string) => void;
|
|
13
14
|
openChildren: (type: "subaward" | "modification") => void; openUpgrade: () => void;
|
|
14
15
|
/** The statement the award's source licence asks for wherever its data is shown. */
|
|
15
16
|
attribution?: string;
|
|
17
|
+
/** How the award's source's amounts read, when it withholds some (GeBIZ). */
|
|
18
|
+
amountNotice?: string;
|
|
16
19
|
}) {
|
|
17
20
|
const colors = useThemeColors();
|
|
18
21
|
const host = useRendererHost();
|
|
@@ -30,6 +33,11 @@ export function AwardDetail({ row, accessKey, width, height, focused, openAward,
|
|
|
30
33
|
usePaneRefreshKey(resource.reload, { focused });
|
|
31
34
|
const loaded = resource.pages[0], detail = loaded?.payload;
|
|
32
35
|
const current = detail?.row ?? row;
|
|
36
|
+
// The board's statements, else the ones the award's own read carries.
|
|
37
|
+
const attribution = statementText(boardAttribution) || statementText(detail?.attribution);
|
|
38
|
+
const amountNotice = statementText(boardAmountNotice) || statementText(detail?.amountNotice);
|
|
39
|
+
// Withheld by the award's own reason (GeBIZ's "under S$6,000"); an amount never printed stays unreported.
|
|
40
|
+
const withheld = amountWithheld(current);
|
|
33
41
|
const scrollRef = useRef<ScrollBoxRenderable | null>(null);
|
|
34
42
|
const loadMore = useTableLoadMore(scrollRef, resource.hasMore, resource.loadMore);
|
|
35
43
|
usePaneStatusFooter({ registrationId: "awards:detail", loading: resource.loading || resource.loadingMore, error: resource.error?.message ?? resource.moreError?.message, stale: loaded?.stale });
|
|
@@ -37,10 +45,11 @@ export function AwardDetail({ row, accessKey, width, height, focused, openAward,
|
|
|
37
45
|
const labelWidth = width < 85 ? 18 : 23;
|
|
38
46
|
return <ScrollBox ref={scrollRef} scrollY width={width} height={desktop ? undefined : height} flexGrow={1} flexBasis={0} contentOptions={{ paddingX: 1 }} onMouseScroll={loadMore}>
|
|
39
47
|
<StatGrid width={Math.max(1, width - 2)} items={[
|
|
40
|
-
{ id: "value", label: `Value (${current.currency})`, value: money(current.awardAmount), detail: current.fieldAsOf?.awardAmount ? `as of ${current.fieldAsOf.awardAmount.slice(0, 10)}` : undefined },
|
|
48
|
+
{ id: "value", label: `Value (${current.currency})`, value: withheld ? WITHHELD_AMOUNT : money(current.awardAmount), detail: withheld ?? (current.fieldAsOf?.awardAmount ? `as of ${current.fieldAsOf.awardAmount.slice(0, 10)}` : undefined) },
|
|
41
49
|
{ id: "obligated", label: `Obligated (${current.currency})`, value: money(current.obligatedAmount), detail: current.fieldAsOf?.obligatedAmount ? `as of ${current.fieldAsOf.obligatedAmount.slice(0, 10)}` : undefined },
|
|
42
50
|
{ id: "ceiling", label: `Ceiling (${current.currency})`, value: money(current.ceilingAmount), detail: current.fieldAsOf?.ceilingAmount ? `as of ${current.fieldAsOf.ceilingAmount.slice(0, 10)}` : undefined },
|
|
43
51
|
]} />
|
|
52
|
+
{withheld && amountNotice ? <Text fg={colors.textDim} width={width - 2} wrapMode="word" wrapText>{amountNotice}</Text> : null}
|
|
44
53
|
<Section title="Contract" width={width - 2}>
|
|
45
54
|
<KeyValueRow label="Awardee" value={current.recipient.name} labelWidth={labelWidth} />
|
|
46
55
|
<KeyValueRow label={current.entity?.parentName && current.entity.parentName !== current.recipient.name ? "Listed parent" : "Listed company"} value={current.entity ? `${current.entity.ticker} · ${current.entity.parentName ?? current.entity.legalName}` : "Unresolved"} labelWidth={labelWidth} />
|
|
@@ -49,8 +58,8 @@ export function AwardDetail({ row, accessKey, width, height, focused, openAward,
|
|
|
49
58
|
{current.awardStatus ? <KeyValueRow label="Status" value={current.awardStatus} labelWidth={labelWidth} /> : null}
|
|
50
59
|
{current.dataBasis === "bulk-latest-transaction" ? <KeyValueRow label="Record basis" value="Latest published transaction" labelWidth={labelWidth} /> : null}
|
|
51
60
|
<KeyValueRow label="Performance period" value={awardPeriod(current)} labelWidth={labelWidth} />
|
|
52
|
-
<KeyValueRow label="Performance place" value={[current.placeOfPerformance?.city, current.placeOfPerformance?.region, current.placeOfPerformance?.country].filter(Boolean).join(", ") ||
|
|
53
|
-
<KeyValueRow label="NAICS / PSC" value={`${current.naics ??
|
|
61
|
+
<KeyValueRow label="Performance place" value={[current.placeOfPerformance?.city, current.placeOfPerformance?.region, current.placeOfPerformance?.country].filter(Boolean).join(", ") || MISSING_VALUE} labelWidth={labelWidth} />
|
|
62
|
+
<KeyValueRow label="NAICS / PSC" value={`${current.naics ?? MISSING_VALUE} / ${current.psc ?? MISSING_VALUE}`} labelWidth={labelWidth} />
|
|
54
63
|
{current.classifications?.map((classification) => <KeyValueRow key={`${classification.scheme}:${classification.code}`} label={classification.scheme.toUpperCase()} value={classification.code} detail={classification.label} labelWidth={labelWidth} />)}
|
|
55
64
|
<KeyValueRow label="Award id" value={current.sourceAwardId} labelWidth={labelWidth} />
|
|
56
65
|
{current.parentAwardId ? <KeyValueRow label="Parent award" value={current.parentAwardId} labelWidth={labelWidth} /> : null}
|
|
@@ -68,7 +77,7 @@ export function AwardDetail({ row, accessKey, width, height, focused, openAward,
|
|
|
68
77
|
<Section title="Evidence" width={width - 2}>
|
|
69
78
|
<KeyValueRow label="Observed (UTC)" value={current.observedAt.replace("T", " ").slice(0, 19)} labelWidth={labelWidth} />
|
|
70
79
|
{current.dataEffectiveDate ? <KeyValueRow label="Record effective" value={current.dataEffectiveDate.slice(0, 10)} labelWidth={labelWidth} /> : null}
|
|
71
|
-
<KeyValueRow label="Confidence" value={current.confidence == null ?
|
|
80
|
+
<KeyValueRow label="Confidence" value={current.confidence == null ? MISSING_VALUE : `${Math.round(current.confidence * 100)}%`} labelWidth={labelWidth} />
|
|
72
81
|
{current.entity ? <KeyValueRow label="Entity match" value={`${current.entity.method.replaceAll("-", " ")} · ${Math.round(current.entity.confidence * 100)}%`} labelWidth={labelWidth} /> : null}
|
|
73
82
|
{current.evidenceQuote ? <Box paddingY={1}><Text fg={colors.textBright} width={width - 2} wrapMode="word" wrapText>{current.evidenceQuote}</Text></Box> : null}
|
|
74
83
|
<Text fg={colors.textDim} width={width - 2} wrapMode="word" wrapText>{current.sourceUrl}</Text>
|
|
@@ -85,8 +94,8 @@ export function AwardDetail({ row, accessKey, width, height, focused, openAward,
|
|
|
85
94
|
<KeyValueRow label="Record" value={revision.id} detail={revision.supersedes ? `Supersedes ${revision.supersedes}` : "Original observation"} labelWidth={labelWidth} />
|
|
86
95
|
<KeyValueRow label="Awardee" value={revision.award.recipient.name} labelWidth={labelWidth} />
|
|
87
96
|
<KeyValueRow label="Agency" value={revision.award.agency.name} labelWidth={labelWidth} />
|
|
88
|
-
<KeyValueRow label="Award date / value" value={`${revision.award.awardDate} · ${revision.award.currency} ${money(revision.award.awardAmount)}`} labelWidth={labelWidth} />
|
|
89
|
-
<KeyValueRow label="Performance period" value={`${revision.award.periodStart ??
|
|
97
|
+
<KeyValueRow label="Award date / value" value={`${revision.award.awardDate} · ${amountWithheld(revision.award) ? WITHHELD_AMOUNT : `${revision.award.currency} ${money(revision.award.awardAmount)}`}`} labelWidth={labelWidth} />
|
|
98
|
+
<KeyValueRow label="Performance period" value={`${revision.award.periodStart ?? MISSING_VALUE} / ${revision.award.periodEnd ?? MISSING_VALUE}`} labelWidth={labelWidth} />
|
|
90
99
|
<Text fg={colors.textDim} width={width - 2} wrapMode="word" wrapText>{revision.award.title}</Text>
|
|
91
100
|
{revision.award.evidenceQuote ? <Text fg={colors.text} width={width - 2} wrapMode="word" wrapText>{revision.award.evidenceQuote}</Text> : null}
|
|
92
101
|
<ActionRow label="Open revision source" onPress={() => void host.openExternal(revision.award.sourceUrl)} />
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { AwardFilter, AwardRow, AwardType } from "../../../api-client/awards";
|
|
2
3
|
import { notATickerSymbol } from "../../../sources/provider-errors";
|
|
3
4
|
import type { HeadlessBundleSection, HeadlessPaneColumn, HeadlessPaneContext, HeadlessPaneDefinition, HeadlessPaneRow } from "../../../types/headless";
|
|
4
5
|
import { DATE_OPTION_EXAMPLES, isoDateOption } from "../../../utils/calendar-date";
|
|
5
6
|
import { resolveHeadlessInstrument } from "../shared/headless-market-data";
|
|
6
7
|
import { fetchAward, fetchAwards } from "./client";
|
|
7
|
-
import { AWARD_TABS, awardsAttributions, awardScope, awardsCoverageNotes, awardsEmptyReason, awardsPreviewNote, awardTypeLabel,
|
|
8
|
+
import { AWARD_TABS, amountWithheld, awardsAmountNotices, awardsAttributions, awardScope, awardsCoverageNotes, awardsEmptyReason, awardsPreviewNote, awardTypeLabel,
|
|
9
|
+
futureAwardDatesNote, money, statementText, WITHHELD_AMOUNT } from "./model";
|
|
8
10
|
import { REPORT_PAGE, REPORT_ROWS } from "../shared/headless-options";
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -23,7 +25,15 @@ async function notATicker(ticker: string, ctx: HeadlessPaneContext): Promise<str
|
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
|
|
28
|
+
/** Marks a value its source withholds (GeBIZ's "under S$6,000"), with why; never an unreported one. */
|
|
29
|
+
const withheldFields = (row: Pick<AwardRow, "awardAmount" | "amountWithheld">) => {
|
|
30
|
+
const why = amountWithheld(row);
|
|
31
|
+
return why ? { valueWithheld: true, amountWithheld: why } : {};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** An award as a report row; `valueWithheld` marks a value its source withholds (GeBIZ), never an unreported one. */
|
|
26
35
|
const awardRecord = (row: AwardRow) => ({ id: row.id, date: row.awardDate, dateBasis: row.dateBasis ?? "award", dataBasis: row.dataBasis ?? null,
|
|
36
|
+
...withheldFields(row),
|
|
27
37
|
fieldAsOf: row.fieldAsOf ?? null, fieldSourceUrls: row.fieldSourceUrls ?? null, recipient: row.recipient.name, ticker: row.entity?.ticker ?? null,
|
|
28
38
|
classifications: row.classifications ?? [],
|
|
29
39
|
agency: row.agency.name, jurisdiction: row.jurisdiction, type: row.awardType, currency: row.currency,
|
|
@@ -39,25 +49,25 @@ const awardRecord = (row: AwardRow) => ({ id: row.id, date: row.awardDate, dateB
|
|
|
39
49
|
* types and scopes by name. Amounts are decimal strings from the source, so
|
|
40
50
|
* exports keep them whole: the compact form is the text report's alone.
|
|
41
51
|
*/
|
|
42
|
-
const text = (value: unknown) => value == null || value === "" ?
|
|
52
|
+
const text = (value: unknown) => value == null || value === "" ? MISSING_VALUE : String(value);
|
|
43
53
|
const amount = (key: string, header: string): HeadlessPaneColumn => ({ key, header, align: "right", textFormat: (value) => money(value as string | null) });
|
|
44
54
|
const nested = (pick: (row: HeadlessPaneRow) => unknown, key: string, header: string): HeadlessPaneColumn => ({ key, header, align: "right",
|
|
45
55
|
format: (_value, row) => text(pick(row)), textFormat: (_value, row) => money(pick(row) as string | null) });
|
|
46
|
-
const share: HeadlessPaneColumn = { key: "sharePercent", header: "Share %", align: "right", format: (value) => typeof value === "number" ? `${value.toFixed(1)}%` :
|
|
47
|
-
const count: HeadlessPaneColumn = { key: "count", header: "Awards", align: "right", textFormat: (value) => typeof value === "number" ? value.toLocaleString("en-US") :
|
|
48
|
-
const scope: HeadlessPaneColumn = { key: "source", header: "Scope", format: (value) => typeof value === "string" ? awardScope(value) :
|
|
49
|
-
const type: HeadlessPaneColumn = { key: "awardType", header: "Type", format: (value) => typeof value === "string" ? awardTypeLabel(value as AwardType) :
|
|
50
|
-
const period = (_value: unknown, row: HeadlessPaneRow) => row.periodStart || row.periodEnd ? `${text(row.periodStart)} / ${text(row.periodEnd)}` :
|
|
56
|
+
const share: HeadlessPaneColumn = { key: "sharePercent", header: "Share %", align: "right", format: (value) => typeof value === "number" ? `${value.toFixed(1)}%` : MISSING_VALUE };
|
|
57
|
+
const count: HeadlessPaneColumn = { key: "count", header: "Awards", align: "right", textFormat: (value) => typeof value === "number" ? value.toLocaleString("en-US") : MISSING_VALUE };
|
|
58
|
+
const scope: HeadlessPaneColumn = { key: "source", header: "Scope", format: (value) => typeof value === "string" ? awardScope(value) : MISSING_VALUE };
|
|
59
|
+
const type: HeadlessPaneColumn = { key: "awardType", header: "Type", format: (value) => typeof value === "string" ? awardTypeLabel(value as AwardType) : MISSING_VALUE };
|
|
60
|
+
const period = (_value: unknown, row: HeadlessPaneRow) => row.periodStart || row.periodEnd ? `${text(row.periodStart)} / ${text(row.periodEnd)}` : MISSING_VALUE;
|
|
51
61
|
const dateBasis = (value: unknown) => value === "period-start" ? "Period start" : value === "publication" ? "Publication" : "Award date";
|
|
52
62
|
const comparison = (row: HeadlessPaneRow) => row.revenueComparison as { awardAmount?: string; annualRevenue?: string; basis?: string; periodEnd?: string } | null;
|
|
53
63
|
const FEED_COLUMNS: HeadlessPaneColumn[] = [
|
|
54
64
|
{ key: "date", header: "Date" }, { key: "recipient", header: "Awardee" }, { key: "ticker", header: "Ticker" }, { key: "currency", header: "CCY" },
|
|
55
|
-
amount("value", "Value"), amount("obligated", "Obligated"), amount("ceiling", "Ceiling"), { key: "agency", header: "Agency" }, { key: "jurisdiction", header: "Country" },
|
|
65
|
+
{ ...amount("value", "Value"), textFormat: (value, row) => value == null && row.valueWithheld ? WITHHELD_AMOUNT : money(value as string | null) }, amount("obligated", "Obligated"), amount("ceiling", "Ceiling"), { key: "agency", header: "Agency" }, { key: "jurisdiction", header: "Country" },
|
|
56
66
|
{ key: "performancePeriod", header: "Performance period", format: period }, { key: "title", header: "Contract" }, { key: "dateBasis", header: "Date basis", format: dateBasis },
|
|
57
67
|
];
|
|
58
68
|
const EVENT_COLUMNS: HeadlessPaneColumn[] = [
|
|
59
69
|
{ key: "date", header: "Date" }, { key: "recipient", header: "Awardee" }, { key: "ticker", header: "Ticker" },
|
|
60
|
-
{ key: "annualRevenuePercent", header: "% revenue", align: "right", format: (value) => typeof value === "number" ? `${value.toFixed(2)}%` :
|
|
70
|
+
{ key: "annualRevenuePercent", header: "% revenue", align: "right", format: (value) => typeof value === "number" ? `${value.toFixed(2)}%` : MISSING_VALUE },
|
|
61
71
|
{ key: "currency", header: "CCY" }, nested((row) => comparison(row)?.awardAmount, "comparedValue", "Compared value"),
|
|
62
72
|
nested((row) => comparison(row)?.annualRevenue, "annualRevenue", "Annual revenue"),
|
|
63
73
|
{ key: "revenueComparison", header: "Value basis", format: (_value, row) => comparison(row)?.basis === "obligated" ? "Obligated" : "Award value" },
|
|
@@ -71,7 +81,9 @@ const aggregateColumns = (label: string): HeadlessPaneColumn[] => [{ key: "label
|
|
|
71
81
|
const LEADER_COLUMNS: HeadlessPaneColumn[] = [{ key: "label", header: "Company" }, { key: "ticker", header: "Ticker" }, { key: "currency", header: "CCY" }, share,
|
|
72
82
|
amount("awardAmount", "Value"), amount("obligatedAmount", "Obligated"), count, { key: "sector", header: "Sector" }, amount("ceilingAmount", "Ceiling"), scope];
|
|
73
83
|
const REVISION_COLUMNS: HeadlessPaneColumn[] = [{ key: "observedAt", header: "Observed" }, { key: "sourceUpdatedAt", header: "Source updated" }, { key: "supersedes", header: "Supersedes" },
|
|
74
|
-
nested((row) => (row.award as AwardRow | undefined)?.awardAmount, "awardAmount", "Value"),
|
|
84
|
+
{ ...nested((row) => (row.award as AwardRow | undefined)?.awardAmount, "awardAmount", "Value"),
|
|
85
|
+
textFormat: (_value, row) => row.valueWithheld ? WITHHELD_AMOUNT : money((row.award as AwardRow | undefined)?.awardAmount ?? null) },
|
|
86
|
+
nested((row) => (row.award as AwardRow | undefined)?.obligatedAmount, "obligatedAmount", "Obligated"),
|
|
75
87
|
{ key: "award", header: "Contract", format: (value) => text((value as AwardRow | undefined)?.title) }];
|
|
76
88
|
const EDGE_COLUMNS: HeadlessPaneColumn[] = [{ key: "kind", header: "Kind" }, { key: "from", header: "From", format: (value) => text((value as { name?: string } | null)?.name) },
|
|
77
89
|
{ key: "to", header: "To", format: (value) => text((value as { name?: string } | null)?.name) }, { key: "currency", header: "CCY" }, amount("amount", "Amount"), { key: "awardId", header: "Award" }];
|
|
@@ -101,10 +113,15 @@ export const awardsHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
101
113
|
async load(args, ctx) {
|
|
102
114
|
if (args.options.award) {
|
|
103
115
|
const detail = await fetchAward(String(args.options.award), ctx.apiClient, ctx.signal, args.options.revisionsCursor ? String(args.options.revisionsCursor) : undefined);
|
|
116
|
+
// The award's source's statements: its licence's, and how its amounts read when one it prints is withheld.
|
|
117
|
+
const withheld = [detail.row, ...detail.revisions.map((revision) => revision.award), ...detail.subawards, ...detail.modifications]
|
|
118
|
+
.some((row) => row && amountWithheld(row));
|
|
119
|
+
const notes = [statementText(detail.attribution), withheld ? statementText(detail.amountNotice) : ""].filter(Boolean);
|
|
104
120
|
return { complete: !detail.locked && !detail.nextRevisionsCursor && !Object.values(detail.truncated ?? {}).some(Boolean), sections: [{ title: "Award", columns: FEED_COLUMNS, rows: detail.row ? [awardRecord(detail.row)] : [] },
|
|
105
|
-
{ title: "Revisions", columns: REVISION_COLUMNS, rows: detail.revisions.map((row) => ({ ...row })) },
|
|
121
|
+
{ title: "Revisions", columns: REVISION_COLUMNS, rows: detail.revisions.map((row) => ({ ...row, ...withheldFields(row.award) })) },
|
|
106
122
|
{ title: "Subawards", columns: FEED_COLUMNS, rows: detail.subawards.map(awardRecord) }, { title: "Modifications", columns: FEED_COLUMNS, rows: detail.modifications.map(awardRecord) },
|
|
107
|
-
{ title: "Relationships", columns: EDGE_COLUMNS, rows: detail.edges.map((row) => ({ ...row })) }],
|
|
123
|
+
{ title: "Relationships", columns: EDGE_COLUMNS, rows: detail.edges.map((row) => ({ ...row })) }], ...(notes.length ? { notes } : {}),
|
|
124
|
+
metadata: { access: detail.access, locked: detail.locked, nextRevisionsCursor: detail.nextRevisionsCursor, truncated: detail.truncated } };
|
|
108
125
|
}
|
|
109
126
|
const filter: AwardFilter = { ticker: args.rawArgument.trim().toUpperCase() || undefined, awardType: args.options.type as AwardFilter["awardType"], limit: Number(args.options.limit ?? 100) };
|
|
110
127
|
for (const key of [...FILTER_KEYS, "cursor"] as const) if (args.options[key]) filter[key] = String(args.options[key]);
|
|
@@ -118,15 +135,20 @@ export const awardsHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
118
135
|
const printed = [...(["feed", "company", "all"].includes(tab) ? data.rows : []), ...(["company", "all"].includes(tab) ? data.history : []),
|
|
119
136
|
...(["agencies", "all"].includes(tab) ? data.agencies : []), ...(["sectors", "all"].includes(tab) ? [...(data.leaders ?? []), ...data.sectors] : []),
|
|
120
137
|
...(["events", "all"].includes(tab) ? data.alerts : [])];
|
|
121
|
-
const
|
|
138
|
+
const record = awardRecord;
|
|
139
|
+
// How a withheld value reads, under the awards that print one.
|
|
140
|
+
const withheld = [...(["feed", "company", "all"].includes(tab) ? data.rows : []), ...(["events", "all"].includes(tab) ? data.alerts : [])]
|
|
141
|
+
.filter((row) => amountWithheld(row)).map((row) => row.source);
|
|
142
|
+
const notes = [...awardsCoverageNotes(data), ...(futureDates ? [futureDates] : []), ...awardsAttributions(data, printed.map((row) => row.source)),
|
|
143
|
+
...awardsAmountNotices(data, withheld)];
|
|
122
144
|
const empty = awardsEmptyReason(data);
|
|
123
145
|
const sections: HeadlessBundleSection[] = [];
|
|
124
|
-
if (tab === "feed" || tab === "company" || tab === "all") sections.push({ title: "Awards", columns: FEED_COLUMNS, rows: data.rows.map(
|
|
146
|
+
if (tab === "feed" || tab === "company" || tab === "all") sections.push({ title: "Awards", columns: FEED_COLUMNS, rows: data.rows.map(record) });
|
|
125
147
|
if (tab === "company" || tab === "all") sections.push({ title: "Award cohorts by month and currency", columns: COHORT_COLUMNS, rows: data.history.map((row) => ({ ...row })) });
|
|
126
148
|
if (tab === "agencies" || tab === "all") sections.push({ title: "Agency concentration", columns: aggregateColumns("Agency"), rows: data.agencies.map((row) => ({ ...row })) });
|
|
127
149
|
if (tab === "sectors" || tab === "all") sections.push({ title: "Sector company leaders", columns: LEADER_COLUMNS, rows: (data.leaders ?? []).map((row) => ({ ...row })) },
|
|
128
150
|
{ title: "Sector totals", columns: aggregateColumns("Sector"), rows: data.sectors.map((row) => ({ ...row })) });
|
|
129
|
-
if (tab === "events" || tab === "all") sections.push({ title: "Awards relative to annual revenue", columns: EVENT_COLUMNS, rows: data.alerts.map(
|
|
151
|
+
if (tab === "events" || tab === "all") sections.push({ title: "Awards relative to annual revenue", columns: EVENT_COLUMNS, rows: data.alerts.map(record) });
|
|
130
152
|
return { complete: !data.locked && !data.nextCursor && data.status === "available" && !Object.values(data.truncated ?? {}).some(Boolean), sections,
|
|
131
153
|
// Collection health is what the awards may be missing, a coverage note; only a failure is an error.
|
|
132
154
|
...(notes.length ? { notes } : {}),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { AwardAggregate, AwardFilter, AwardHistoryPoint, AwardRow, AwardsPayload, AwardType } from "../../../api-client/awards";
|
|
2
3
|
import { staticSeries } from "../../../components/chart/static/series";
|
|
3
4
|
import type { ResolvedSeries } from "../../../time-series/types";
|
|
@@ -9,15 +10,15 @@ export type AwardTab = typeof AWARD_TABS[number]["value"];
|
|
|
9
10
|
export const awardTab = (value: unknown): AwardTab => AWARD_TABS.find((tab) => tab.value === value)?.value ?? "feed";
|
|
10
11
|
export const awardTypeLabel = (value: AwardType) => ({ prime: "Prime", subaward: "Subaward", modification: "Modification", notice: "Notice" })[value];
|
|
11
12
|
export function money(value: string | number | null | undefined): string {
|
|
12
|
-
if (value == null) return
|
|
13
|
+
if (value == null) return MISSING_VALUE;
|
|
13
14
|
const amount = Number(value), absolute = Math.abs(amount);
|
|
14
15
|
for (const [scale, suffix] of [[1e12, "T"], [1e9, "B"], [1e6, "M"], [1e3, "K"]] as const) {
|
|
15
16
|
if (absolute >= scale) return `${(amount / scale).toFixed(2)}${suffix}`;
|
|
16
17
|
}
|
|
17
18
|
return amount.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
18
19
|
}
|
|
19
|
-
export const awardPeriod = (row: AwardRow) => row.periodStart || row.periodEnd ? `${row.periodStart ??
|
|
20
|
-
export const awardPercent = (row: AwardRow) => row.revenueComparison ? `${row.revenueComparison.percent.toFixed(2)}%` :
|
|
20
|
+
export const awardPeriod = (row: AwardRow) => row.periodStart || row.periodEnd ? `${row.periodStart ?? MISSING_VALUE} / ${row.periodEnd ?? MISSING_VALUE}` : MISSING_VALUE;
|
|
21
|
+
export const awardPercent = (row: AwardRow) => row.revenueComparison ? `${row.revenueComparison.percent.toFixed(2)}%` : MISSING_VALUE;
|
|
21
22
|
export const aggregateId = (row: AwardAggregate) => JSON.stringify([row.key, row.source, row.currency, row.awardType]);
|
|
22
23
|
const historyDate = (row: AwardHistoryPoint) => new Date(`${row.month.slice(0, 7)}-01T00:00:00Z`);
|
|
23
24
|
export const awardScope = (source: string) => ({ usaspending: "US federal contracts", "usaspending-subawards": "US federal subcontracts", "usaspending-transactions": "US contract actions", "uk-contracts-finder": "UK contract notices",
|
|
@@ -91,9 +92,43 @@ export function awardsCoverageNotes(data: Pick<AwardsPayload, "gaps">): string[]
|
|
|
91
92
|
* award's detail and `fn AWARDS` print them under the awards they cover.
|
|
92
93
|
*/
|
|
93
94
|
export function awardsAttributions(data: Pick<AwardsPayload, "sources"> | undefined, shown: Iterable<string>): string[] {
|
|
95
|
+
return sourceStatements(data, shown, "attribution");
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* How the amounts of the sources shown read, each once: GeBIZ's says it
|
|
100
|
+
* withholds an amount under S$6,000 or one that several suppliers of a tender
|
|
101
|
+
* print alike. The award's detail and `fn AWARDS` print them beside a
|
|
102
|
+
* withheld value.
|
|
103
|
+
*/
|
|
104
|
+
export function awardsAmountNotices(data: Pick<AwardsPayload, "sources"> | undefined, shown: Iterable<string>): string[] {
|
|
105
|
+
return sourceStatements(data, shown, "amountNotice");
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function sourceStatements(data: Pick<AwardsPayload, "sources"> | undefined, shown: Iterable<string>, key: "attribution" | "amountNotice"): string[] {
|
|
94
109
|
const sources = new Set(shown);
|
|
95
|
-
return [...new Set((data?.sources ?? []).flatMap((source) =>
|
|
96
|
-
|
|
110
|
+
return [...new Set((data?.sources ?? []).flatMap((source) => {
|
|
111
|
+
const statement = source[key];
|
|
112
|
+
return sources.has(source.source) && typeof statement === "string" && statement.trim() ? [statement.trim()] : [];
|
|
113
|
+
}))];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** What an award's value reads when its source withholds it, never 0 and never the unreported mark. */
|
|
117
|
+
export const WITHHELD_AMOUNT = "withheld";
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Why an award's value is withheld by its source rather than unreported, or
|
|
121
|
+
* null: the award's own reason (GeBIZ's "under S$6,000"), never its source's,
|
|
122
|
+
* so an amount the source never printed still reads unreported.
|
|
123
|
+
*/
|
|
124
|
+
export function amountWithheld(row: Pick<AwardRow, "awardAmount" | "amountWithheld">): string | null {
|
|
125
|
+
const why = row.amountWithheld;
|
|
126
|
+
return row.awardAmount == null && typeof why === "string" && why.trim() ? why.trim() : null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** A source's statement as served, or nothing: an older or malformed answer's non-string is never read as one. */
|
|
130
|
+
export function statementText(value: unknown): string {
|
|
131
|
+
return typeof value === "string" ? value.trim() : "";
|
|
97
132
|
}
|
|
98
133
|
|
|
99
134
|
/** Award dates after the response's own date are the source's, not a mapping slip; they say so instead of passing as past awards. */
|
|
@@ -14,7 +14,7 @@ import type { PaneProps } from "../../../types/plugin";
|
|
|
14
14
|
import { Box, Text, TextAttributes, useRendererHost, useUiCapabilities, type ScrollBoxRenderable } from "../../../ui";
|
|
15
15
|
import { withCountryFlag } from "../../../components/ui/country-flag";
|
|
16
16
|
import { publicTickerKey } from "../../../utils/exchanges";
|
|
17
|
-
import { truncateToDisplayWidth } from "../../../utils/format";
|
|
17
|
+
import { MISSING_VALUE, truncateToDisplayWidth } from "../../../utils/format";
|
|
18
18
|
import { wrapTextLines } from "../../../utils/text-wrap";
|
|
19
19
|
import { SignInWall } from "../cloud/auth-actions";
|
|
20
20
|
import { CLOUD_PLAN_KEY, useCloudUpgradeAction } from "../shared/cloud-upgrade";
|
|
@@ -25,8 +25,8 @@ import { AwardDetail } from "./detail";
|
|
|
25
25
|
import { useAwardAlerts } from "./alerts";
|
|
26
26
|
import { AWARDS_UNAVAILABLE, fetchAwards, loadAward, loadAwards, validateAwards } from "./client";
|
|
27
27
|
import { useAwardsEvidence } from "./evidence";
|
|
28
|
-
import { AWARD_TABS, aggregateId, awardHistorySeries, awardPercent, awardPeriod, awardsAttributions, awardScope, awardsCoverageNotes, awardsPreviewNote,
|
|
29
|
-
futureAwardDatesNote, money, rankedAggregates } from "./model";
|
|
28
|
+
import { AWARD_TABS, aggregateId, amountWithheld, awardHistorySeries, awardPercent, awardPeriod, awardsAmountNotices, awardsAttributions, awardScope, awardsCoverageNotes, awardsPreviewNote,
|
|
29
|
+
awardTab, awardTypeLabel, futureAwardDatesNote, money, rankedAggregates, WITHHELD_AMOUNT } from "./model";
|
|
30
30
|
import { logFailure } from "../../../utils/log-failure";
|
|
31
31
|
|
|
32
32
|
type Item = { kind: "award"; row: AwardRow } | { kind: "aggregate"; row: AwardAggregate } | { kind: "leader"; row: AwardCompanyLeader } | { kind: "locked"; id: string }
|
|
@@ -60,7 +60,7 @@ const COLUMN = {
|
|
|
60
60
|
const FEED_COLUMNS: DataTableColumn[] = [COLUMN.date, COLUMN.recipient, COLUMN.ticker, COLUMN.title, COLUMN.agency, COLUMN.currency,
|
|
61
61
|
COLUMN.value, COLUMN.obligated, COLUMN.ceiling, COLUMN.country, COLUMN.period, COLUMN.dateBasis];
|
|
62
62
|
/** Amounts a source never reports (UK and EU notices have no obligation or ceiling) leave a column of dashes. */
|
|
63
|
-
const QUIET_AMOUNTS = { obligated: [
|
|
63
|
+
const QUIET_AMOUNTS = { obligated: [MISSING_VALUE], ceiling: [MISSING_VALUE] } as const;
|
|
64
64
|
const EVENT_COLUMNS: DataTableColumn[] = [COLUMN.date, COLUMN.recipient, COLUMN.ticker,
|
|
65
65
|
{ id: "ratio", label: "% revenue", width: 11, align: "right" }, COLUMN.currency, { ...COLUMN.value, label: "Compared value" },
|
|
66
66
|
{ id: "revenue", label: "Annual revenue", width: 14, align: "right" }, { id: "basis", label: "Value basis", width: 13, align: "left" },
|
|
@@ -202,6 +202,7 @@ function AwardsView({ width, height, focused, symbol }: PaneProps & { symbol: st
|
|
|
202
202
|
const attribution = awardsAttributions(data, shown.flatMap((item) => item.kind === "award" || item.kind === "aggregate" || item.kind === "leader" ? [item.row.source] : [])).join(" ");
|
|
203
203
|
const attributionRows = attribution ? wrapTextLines(attribution, Math.max(1, width - 2)).length : 0;
|
|
204
204
|
const openAttribution = openRow ? awardsAttributions(data, [openRow.source]).join(" ") : "";
|
|
205
|
+
const openAmountNotice = openRow ? awardsAmountNotices(data, [openRow.source]).join(" ") : "";
|
|
205
206
|
const { strip, rows: tabRows } = usePaneTabs(!denied ? { tabs: [...AWARD_TABS], activeValue: tab, onSelect: (value) => { setTab(value); setOpen(null); }, focused, dense: true } : null);
|
|
206
207
|
const bodyHeight = Math.max(3, height - tabRows);
|
|
207
208
|
const filters: QueryBarFilter[] = [
|
|
@@ -219,7 +220,7 @@ function AwardsView({ width, height, focused, symbol }: PaneProps & { symbol: st
|
|
|
219
220
|
view={tab === "sectors" ? { value: leaderView, options: [{ value: "companies", label: "Companies" }, { value: "sectors", label: "Sectors" }], onChange: setLeaderView } : undefined} />;
|
|
220
221
|
const columns = showLeaders ? LEADER_COLUMNS.filter((column) => column.id !== "scope" && column.id !== "currency")
|
|
221
222
|
: aggregated ? AGG_COLUMNS.filter((column) => column.id !== "scope" && column.id !== "currency").map((column) => column.id === "label" ? { ...column, label: tab === "agencies" ? "Agency" : "Sector" } : column)
|
|
222
|
-
: tab === "events" ? EVENT_COLUMNS : withoutQuietColumns(FEED_COLUMNS, rows, (row, id) => (id === "obligated" ? row.obligatedAmount : row.ceilingAmount) ??
|
|
223
|
+
: tab === "events" ? EVENT_COLUMNS : withoutQuietColumns(FEED_COLUMNS, rows, (row, id) => (id === "obligated" ? row.obligatedAmount : row.ceilingAmount) ?? MISSING_VALUE, QUIET_AMOUNTS);
|
|
223
224
|
const maxShare = Math.max(0, ...items.map((item) => item.kind === "aggregate" || item.kind === "leader" ? item.row.sharePercent ?? 0 : 0));
|
|
224
225
|
// A preview's cohorts are the latest of any company, so they never chart as the ticker's.
|
|
225
226
|
const charted = data?.locked ? [] : series;
|
|
@@ -231,7 +232,7 @@ function AwardsView({ width, height, focused, symbol }: PaneProps & { symbol: st
|
|
|
231
232
|
return <Box width={width} height={height} flexDirection="column">
|
|
232
233
|
{strip}
|
|
233
234
|
<PageStackView focused={focused} detailOpen={!!openId} onBack={() => setOpen(null)} detailTitle={openRow ? truncateToDisplayWidth(openRow.title, Math.max(20, width - 16)) : "Award evidence"}
|
|
234
|
-
detailContent={openRow ? <AwardDetail key={openRow.id} row={openRow} accessKey={accessKey} width={width} height={bodyHeight - 1} focused={focused} openAward={setOpen} openUpgrade={openUpgrade} attribution={openAttribution}
|
|
235
|
+
detailContent={openRow ? <AwardDetail key={openRow.id} row={openRow} accessKey={accessKey} width={width} height={bodyHeight - 1} focused={focused} openAward={setOpen} openUpgrade={openUpgrade} attribution={openAttribution} amountNotice={openAmountNotice}
|
|
235
236
|
openChildren={(type) => { setParentId(openRow.id); setTicker(""); setSource(""); setQuery(""); setAgency(""); setSector(""); setCurrency(""); setJurisdiction(""); setRange("all"); setType(type); setOpen(null); setTab("feed"); }} />
|
|
236
237
|
: <PaneStatusBody loading={detail.loading} error={detail.error} empty={!detail.loading && !detail.error} emptyTitle="Award no longer available." subject="award evidence" />}
|
|
237
238
|
rootContent={<DataTableView<Item> columns={columns} items={tab === "company" && !ticker ? [] : items} rootWidth={width} rootHeight={bodyHeight}
|
|
@@ -261,7 +262,9 @@ function AwardsView({ width, height, focused, symbol }: PaneProps & { symbol: st
|
|
|
261
262
|
if (column.id === "currency") return { text: row.currency, color: colors.textDim };
|
|
262
263
|
if (["value", "obligated", "ceiling"].includes(column.id)) {
|
|
263
264
|
const value = column.id === "value" ? tab === "events" && item.kind === "award" ? item.row.revenueComparison?.awardAmount : row.awardAmount : column.id === "obligated" ? row.obligatedAmount : row.ceilingAmount;
|
|
264
|
-
|
|
265
|
+
if (value == null) return column.id === "value" && item.kind === "award" && tab !== "events" && amountWithheld(item.row)
|
|
266
|
+
? { text: WITHHELD_AMOUNT, value: null, color: colors.textMuted } : missingCell(colors);
|
|
267
|
+
return { text: money(value), value, color: column.id === "obligated" || column.id === "value" ? colors.textBright : colors.text };
|
|
265
268
|
}
|
|
266
269
|
if (item.kind === "aggregate" || item.kind === "leader") {
|
|
267
270
|
if (column.id === "label") return { text: item.row.label, color: colors.textBright };
|
|
@@ -285,7 +288,7 @@ function AwardsView({ width, height, focused, symbol }: PaneProps & { symbol: st
|
|
|
285
288
|
if (column.id === "ratio") return { text: awardPercent(award), value: award.revenueComparison?.percent ?? null, color: colors.warning, attributes: TextAttributes.BOLD, keepColorWhenSelected: true };
|
|
286
289
|
if (column.id === "revenue") return { text: money(award.revenueComparison?.annualRevenue), value: award.revenueComparison?.annualRevenue ?? null };
|
|
287
290
|
if (column.id === "basis") return { text: award.revenueComparison?.basis === "obligated" ? "Obligated" : "Award value", color: colors.textDim };
|
|
288
|
-
return { text: award.revenueComparison?.periodEnd ??
|
|
291
|
+
return { text: award.revenueComparison?.periodEnd ?? MISSING_VALUE, color: colors.textDim };
|
|
289
292
|
}}
|
|
290
293
|
emptyStateTitle={tab === "company" && !ticker ? "Enter a company ticker." : tab === "events" ? "No revenue-comparable awards in this scope." : "No awards match these filters."}
|
|
291
294
|
rootAfter={attribution ? <Box paddingX={1} height={attributionRows} flexShrink={0}><Notice tone="muted">{attribution}</Notice></Box> : undefined}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { BacktestResult } from "./engine";
|
|
2
3
|
import { currencyPairCode, fxRateDigits } from "../../../utils/currency-pair";
|
|
3
4
|
|
|
@@ -44,7 +45,7 @@ export const SUMMARY_ROWS: SummaryRow[] = [
|
|
|
44
45
|
];
|
|
45
46
|
|
|
46
47
|
export function formatStat(stat: StatValue | null): string {
|
|
47
|
-
if (!stat || stat.value == null || !Number.isFinite(stat.value)) return
|
|
48
|
+
if (!stat || stat.value == null || !Number.isFinite(stat.value)) return MISSING_VALUE;
|
|
48
49
|
const { value, kind } = stat;
|
|
49
50
|
if (kind === "count") return String(Math.round(value));
|
|
50
51
|
if (kind === "ratio") return value.toFixed(2);
|
|
@@ -59,7 +60,7 @@ export function formatStat(stat: StatValue | null): string {
|
|
|
59
60
|
* `--` for a trade still open.
|
|
60
61
|
*/
|
|
61
62
|
export function formatTradePrice(value: number | null | undefined, symbol: string): string {
|
|
62
|
-
if (value == null || !Number.isFinite(value)) return
|
|
63
|
+
if (value == null || !Number.isFinite(value)) return MISSING_VALUE;
|
|
63
64
|
const pair = currencyPairCode(symbol);
|
|
64
65
|
if (pair) return value.toFixed(fxRateDigits(pair.slice(3), value));
|
|
65
66
|
return Math.abs(value) >= 1 ? value.toFixed(2) : value.toPrecision(4);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { cleanFloat32Price, historyUnit } from "../../../cli/history-rows";
|
|
2
3
|
import { barsPerYearLabel } from "../../../market-data/bars-per-year";
|
|
3
4
|
import { ROLLS_BACK_ADJUSTED } from "../../../market-data/futures-roll-returns";
|
|
@@ -37,9 +38,9 @@ export function backtestPriceUnit(symbol: string, quote: { currency?: string; in
|
|
|
37
38
|
return unit.currency ?? unit.unit;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
const fixed = (digits: number) => (value: unknown) => typeof value === "number" && Number.isFinite(value) ? value.toFixed(digits) :
|
|
41
|
+
const fixed = (digits: number) => (value: unknown) => typeof value === "number" && Number.isFinite(value) ? value.toFixed(digits) : MISSING_VALUE;
|
|
41
42
|
/** Prices as the trades table drew them, with the digits a sub-unit price needs. */
|
|
42
|
-
const price = (value: unknown) => typeof value !== "number" || !Number.isFinite(value) ?
|
|
43
|
+
const price = (value: unknown) => typeof value !== "number" || !Number.isFinite(value) ? MISSING_VALUE
|
|
43
44
|
: Math.abs(value) >= 1 ? value.toFixed(2) : value.toPrecision(4);
|
|
44
45
|
|
|
45
46
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
2
3
|
import { DATE_OPTION_EXAMPLES, isoDateOption } from "../../../utils/calendar-date";
|
|
3
4
|
import { loadBondBenchmark } from "./client";
|
|
@@ -50,7 +51,7 @@ export const bondCalculatorHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
50
51
|
{ label: "Treasury spread", value: result.spread?.spreadBps ?? null, formatted: result.spread ? `${result.spread.spreadBps.toFixed(1)} bp as of ${result.spread.asOf}` : "Unavailable" },
|
|
51
52
|
] },
|
|
52
53
|
{ title: "Cash flows per 100 face", columns: [{ key: "date", header: "Payment" }, { key: "amount", header: "Cash", format: (n) => Number(n).toFixed(4) }, { key: "presentValue", header: "Present value", format: (n) => Number(n).toFixed(4) }], rows: a.cashFlows.map((flow) => ({ ...flow })) },
|
|
53
|
-
{ title: "Yield sensitivity", columns: [{ key: "shiftBps", header: "Shift bp" }, { key: "yieldPercent", header: "Yield %" }, { key: "cleanPrice", header: "Clean price", format: (n) => n == null ?
|
|
54
|
+
{ title: "Yield sensitivity", columns: [{ key: "shiftBps", header: "Shift bp" }, { key: "yieldPercent", header: "Yield %" }, { key: "cleanPrice", header: "Clean price", format: (n) => n == null ? MISSING_VALUE : Number(n).toFixed(4) }, { key: "priceChange", header: "Change", format: (n) => n == null ? MISSING_VALUE : Number(n).toFixed(4) }], rows: result.sensitivity },
|
|
54
55
|
],
|
|
55
56
|
};
|
|
56
57
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
2
3
|
import { Box, ScrollBox } from "../../../ui";
|
|
3
4
|
import { DataTableView, FieldGrid, KeyValueRow, Notice, QueryBar, Section, usePaneNoticeFooter, usePaneTabs, type GridField, type SelectControl } from "../../../components";
|
|
@@ -29,7 +30,7 @@ const SHOCK_COLUMNS = [
|
|
|
29
30
|
{ id: "returnPercent", label: "Return %", width: 12, align: "right" as const },
|
|
30
31
|
];
|
|
31
32
|
const loadBenchmark = () => loadBondBenchmark();
|
|
32
|
-
const fixed = (value: number | null | undefined, digits = 4) => value == null ?
|
|
33
|
+
const fixed = (value: number | null | undefined, digits = 4) => value == null ? MISSING_VALUE : value.toFixed(digits);
|
|
33
34
|
|
|
34
35
|
export function BondCalculatorPane({ focused, width, height }: PaneProps) {
|
|
35
36
|
const [settlement] = usePaneSettingValue<string | undefined>("settlement", undefined);
|
|
@@ -138,7 +138,7 @@ export function useBrokerAddFlow({
|
|
|
138
138
|
|
|
139
139
|
const start = useCallback(() => {
|
|
140
140
|
endAttemptRef.current?.("cancelled");
|
|
141
|
-
if (listAdaptersRef.current().some((adapter) => adapter.id === SIGNED_IN_BROKER_TYPE))
|
|
141
|
+
if (listAdaptersRef.current().some((adapter) => adapter.id === SIGNED_IN_BROKER_TYPE)) refreshSignedInBrokers();
|
|
142
142
|
flowSequence += 1;
|
|
143
143
|
setFlow(() => ({ id: flowSequence, directory: buildDirectory(), step: { kind: "broker" }, cursor: 0 }));
|
|
144
144
|
setMessage(null);
|
|
@@ -369,6 +369,7 @@ export const brokerManagerModule: PluginModule = {
|
|
|
369
369
|
reportFreshness: { status: "not-a-feed", basis: "broker connections", local: true },
|
|
370
370
|
defaultPosition: "right",
|
|
371
371
|
defaultMode: "floating",
|
|
372
|
+
utilityWindow: true,
|
|
372
373
|
defaultFloatingSize: { width: 92, height: 24 },
|
|
373
374
|
portableShare: {
|
|
374
375
|
private: { title: true, params: true, settings: true, state: true },
|
|
@@ -19,7 +19,7 @@ const INSTRUMENT_CATEGORY: Record<string, string> = { option: "OPT", future: "FU
|
|
|
19
19
|
export const brokerTradingModule: PluginModule = {
|
|
20
20
|
panes: [{
|
|
21
21
|
id: "broker-orders", name: "Orders", personalData: "account", icon: "O", component: BrokerOrdersPane,
|
|
22
|
-
defaultPosition: "right", defaultMode: "floating",
|
|
22
|
+
defaultPosition: "right", defaultMode: "floating", utilityWindow: true,
|
|
23
23
|
defaultFloatingSize: { width: 100, height: 30 }, headless: brokerOrdersHeadless,
|
|
24
24
|
portableShare: { private: { title: true, params: true, settings: true, state: true } },
|
|
25
25
|
}],
|
|
@@ -2,7 +2,7 @@ import type { BrokerAdapter } from "../../../types/broker";
|
|
|
2
2
|
import type { BrokerInstanceConfig } from "../../../types/config";
|
|
3
3
|
import type { BrokerExecution, BrokerOrder, BrokerOrderRequest } from "../../../types/trading";
|
|
4
4
|
import type { Quote } from "../../../types/financials";
|
|
5
|
-
import { formatNumber } from "../../../utils/format";
|
|
5
|
+
import { MISSING_VALUE, formatNumber } from "../../../utils/format";
|
|
6
6
|
|
|
7
7
|
export interface BrokerOrdersSnapshot {
|
|
8
8
|
brokerInstanceId: string;
|
|
@@ -60,8 +60,8 @@ export function canChangeBrokerOrder(order: BrokerOrder): boolean {
|
|
|
60
60
|
return !DONE.has(status) && status !== "Pending cancel" && status !== "UNKNOWN" && order.remaining > 0;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export const formatOrderQuantity = (value: number) => Number.isFinite(value) ? formatNumber(value, Number.isInteger(value) ? 0 : 4) :
|
|
64
|
-
export const formatOrderPrice = (value: number | undefined) => value != null && Number.isFinite(value) ? formatNumber(value, 2) :
|
|
63
|
+
export const formatOrderQuantity = (value: number) => Number.isFinite(value) ? formatNumber(value, Number.isInteger(value) ? 0 : 4) : MISSING_VALUE;
|
|
64
|
+
export const formatOrderPrice = (value: number | undefined) => value != null && Number.isFinite(value) ? formatNumber(value, 2) : MISSING_VALUE;
|
|
65
65
|
/** Execution sides as brokers write them: BUY, BOT or B. */
|
|
66
66
|
export const isBuySide = (side: string) => ["BUY", "BOT", "B"].includes(side.toUpperCase());
|
|
67
67
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { logFailure } from "../../../utils/log-failure";
|
|
2
3
|
import { useCallback, useEffect, useId, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
3
4
|
import {
|
|
@@ -87,7 +88,7 @@ function orderPriceText(order: BrokerOrder): string {
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
function age(timestamp: number, now: number): string {
|
|
90
|
-
if (!Number.isFinite(timestamp) || timestamp <= 0) return
|
|
91
|
+
if (!Number.isFinite(timestamp) || timestamp <= 0) return MISSING_VALUE;
|
|
91
92
|
const seconds = Math.max(0, Math.floor((now - timestamp) / 1_000));
|
|
92
93
|
if (seconds < 60) return `${seconds}s`;
|
|
93
94
|
if (seconds < 3600) return `${Math.floor(seconds / 60)}m`;
|
|
@@ -156,7 +157,7 @@ function renderExecutionCell(execution: BrokerExecution, column: DataTableColumn
|
|
|
156
157
|
case "side": return { text: execution.side, content: <Badge label={execution.side} tone={isBuySide(execution.side) ? "positive" : "negative"} /> };
|
|
157
158
|
case "quantity": return { text: quantity(execution.shares), value: execution.shares };
|
|
158
159
|
case "price": return { text: price(execution.price), value: execution.price };
|
|
159
|
-
case "fees": return { text: execution.commission === undefined ?
|
|
160
|
+
case "fees": return { text: execution.commission === undefined ? MISSING_VALUE : `${price(execution.commission)} ${execution.commissionCurrency ?? ""}`.trim() };
|
|
160
161
|
default: return { text: age(execution.time, now), color: colors.textDim };
|
|
161
162
|
}
|
|
162
163
|
}
|
|
@@ -7,7 +7,7 @@ import { afterLayout, revealInScrollBox } from "../../../components/ui/reveal-in
|
|
|
7
7
|
import { useThemeColors } from "../../../theme/theme-context";
|
|
8
8
|
import type { Quote } from "../../../types/financials";
|
|
9
9
|
import { quoteAgeText } from "../../../market-data/quotes/freshness";
|
|
10
|
-
import { formatPercentRaw } from "../../../utils/format";
|
|
10
|
+
import { MISSING_VALUE, formatPercentRaw } from "../../../utils/format";
|
|
11
11
|
import type { BrokerAccount, BrokerOrder, BrokerOrderPreview, BrokerOrderRequest, BrokerTradingCapabilities } from "../../../types/trading";
|
|
12
12
|
import { Box, ScrollBox, Text, TextAttributes, useUiCapabilities, type BoxRenderable, type ScrollBoxRenderable } from "../../../ui";
|
|
13
13
|
import { useDialogState } from "../../../ui/dialog";
|
|
@@ -149,7 +149,7 @@ function DockedQuote({ quote, delayed, stale, source, updated, price, change, wi
|
|
|
149
149
|
</Box>;
|
|
150
150
|
return <Box flexDirection="column" gap={native ? 0.2 : 0} data-gloom-selectable="true">
|
|
151
151
|
<Box flexDirection="row" gap={1} alignItems={native ? "baseline" : "center"}>
|
|
152
|
-
<FigureText>{quote?.price === undefined ?
|
|
152
|
+
<FigureText>{quote?.price === undefined ? MISSING_VALUE : price(quote.price)}</FigureText>
|
|
153
153
|
<Box flexGrow={1} minWidth={0}><FigureText part="sub" change={quote?.change}>{change}</FigureText></Box>
|
|
154
154
|
{delayed ? <Box flexShrink={0} title={`${source} · ${updated}`}><Icon name="clock" color={c.warning} /></Box> : null}
|
|
155
155
|
{stale ? <Text fg={c.warning} flexShrink={0}>{stale}</Text> : null}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { TextAttributes } from "../../../ui";
|
|
2
3
|
import type { DataTableCell } from "../../../components";
|
|
3
4
|
import { colors } from "../../../theme/colors";
|
|
@@ -61,7 +62,7 @@ export function renderBuildoutCell(
|
|
|
61
62
|
case "listDescription":
|
|
62
63
|
return { text: text(list.shortDescription ?? list.description), color: colors.textDim };
|
|
63
64
|
case "companyCount":
|
|
64
|
-
return { text: list.companyCount == null ?
|
|
65
|
+
return { text: list.companyCount == null ? MISSING_VALUE : String(list.companyCount), color: colors.textDim };
|
|
65
66
|
case "totalMarketCap":
|
|
66
67
|
return moneyCell(list.totalMarketCap, colors.textDim);
|
|
67
68
|
case "avgSectorGrowth":
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../../utils/format";
|
|
1
2
|
import { useCallback, useMemo, useState, type ReactNode } from "react";
|
|
2
3
|
import {
|
|
3
4
|
Button,
|
|
@@ -114,7 +115,7 @@ function siteCell(site: BuildoutCompanySite, column: SiteColumn, dim: string, br
|
|
|
114
115
|
case "site": return { text: site.name, color: bright };
|
|
115
116
|
case "type": return { text: text(site.type), color: dim };
|
|
116
117
|
case "role": return { text: site.role === "owner" ? "Owner" : "Partner", color: dim };
|
|
117
|
-
case "mw": return { text: site.mw == null ?
|
|
118
|
+
case "mw": return { text: site.mw == null ? MISSING_VALUE : site.mw.toLocaleString("en-US"), ...(site.mw == null ? {} : { value: site.mw }), color: dim };
|
|
118
119
|
case "place": return { text: text(site.place), color: dim };
|
|
119
120
|
}
|
|
120
121
|
}
|
|
@@ -122,8 +123,8 @@ function siteCell(site: BuildoutCompanySite, column: SiteColumn, dim: string, br
|
|
|
122
123
|
function hiringCell(segment: BuildoutHiringSegment, column: HiringColumn, dim: string, bright: string): DataTableCell {
|
|
123
124
|
switch (column.id) {
|
|
124
125
|
case "place": return { text: segment.place, color: bright };
|
|
125
|
-
case "roles": return { text: segment.roles == null ?
|
|
126
|
-
case "change": return { text: segment.change == null ?
|
|
126
|
+
case "roles": return { text: segment.roles == null ? MISSING_VALUE : String(segment.roles), color: bright };
|
|
127
|
+
case "change": return { text: segment.change == null ? MISSING_VALUE : `${segment.change > 0 ? "+" : ""}${segment.change}`, color: segment.change ? priceColor(segment.change) : dim };
|
|
127
128
|
case "family": return { text: text(segment.roleFamily), color: dim };
|
|
128
129
|
case "site": return { text: text(segment.site), color: dim };
|
|
129
130
|
}
|