@gloom-sh/terminal 0.20.10 → 0.20.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +16 -0
- 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 +18 -1
- package/src/api-client/request.ts +86 -3
- package/src/api-client/socket-connection.ts +366 -0
- package/src/api-client/socket-features.ts +75 -0
- package/src/api-client/socket-frames.ts +161 -0
- package/src/api-client/socket-listeners.ts +207 -0
- package/src/api-client/socket-quotes.ts +332 -0
- package/src/api-client/socket.ts +168 -983
- package/src/api-client/supply-chain-graph.ts +4 -2
- package/src/api-client/supply-chain.ts +8 -0
- package/src/api-client/types/econ.ts +10 -7
- package/src/api-client/types/filings-and-calls.ts +8 -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/brokers/signed-in/adapter.ts +19 -5
- package/src/brokers/signed-in/client.ts +13 -1
- package/src/brokers/signed-in/sign-in-dialog.tsx +33 -9
- 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 +209 -31
- package/src/cli/commands/overview.ts +47 -14
- package/src/cli/commands/search.ts +37 -8
- package/src/cli/commands/ticker.ts +15 -4
- package/src/cli/desktop-pane-shot.ts +27 -2
- 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/index.ts +1 -1
- package/src/cli/list-progress.ts +45 -0
- package/src/cli/listing-arg.ts +71 -7
- package/src/cli/name-entries.ts +8 -4
- package/src/cli/not-a-ticker.ts +2 -2
- package/src/cli/pane-functions/freshness.ts +50 -3
- package/src/cli/pane-functions/index.ts +7 -4
- package/src/cli/pane-functions/market-session.ts +66 -14
- package/src/cli/pane-functions/options.ts +5 -0
- 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/quote-answer.ts +49 -10
- package/src/cli/quote-list-reads.ts +87 -0
- package/src/cli/report-tables.ts +70 -13
- package/src/cli/result.ts +24 -2
- 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/native/kitty/manager.ts +2 -0
- package/src/components/chart/native/surface/manager.ts +211 -11
- package/src/components/command-bar/action-runtime.ts +2 -0
- package/src/components/command-bar/panel/index.tsx +2 -13
- package/src/components/command-bar/panel/layout.ts +1 -7
- package/src/components/command-bar/panel/runtime.ts +0 -1
- package/src/components/command-bar/panel/types.ts +0 -2
- 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/column-menu.tsx +89 -0
- package/src/components/data-table/sort-menu.tsx +9 -2
- package/src/components/data-table/view.tsx +33 -6
- package/src/components/form-modal/content.tsx +10 -0
- package/src/components/index.ts +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/pane/cycle-order.ts +66 -2
- package/src/components/layout/pane/footer/index.tsx +25 -11
- package/src/components/layout/pane/footer/model.ts +62 -20
- package/src/components/layout/pane/header.tsx +140 -31
- package/src/components/layout/pane/sidebar.tsx +138 -20
- package/src/components/layout/pane/status-footer.ts +3 -1
- package/src/components/layout/shell/active-drag.ts +18 -13
- package/src/components/layout/shell/drag/magnets.ts +34 -18
- 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/market-board/index.tsx +14 -5
- package/src/components/metric-treemap/index.tsx +3 -1
- package/src/components/ticker/list-table-view.tsx +5 -0
- package/src/components/ui/button.tsx +48 -4
- package/src/components/ui/data-table/column-order.ts +180 -0
- package/src/components/ui/data-table/index.tsx +12 -1
- package/src/components/ui/data-table/opentui/index.tsx +291 -32
- package/src/components/ui/data-table/opentui/model.ts +43 -4
- package/src/components/ui/data-table/types.ts +56 -0
- package/src/components/ui/data-table/use-column-order.ts +135 -0
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/inline-quick-add.tsx +19 -3
- package/src/components/ui/list-view.tsx +11 -5
- package/src/components/ui/query-bar.tsx +16 -1
- package/src/components/ui/selection-fill.ts +39 -0
- package/src/components/ui/table-layout.ts +120 -0
- 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/docs/snapshot.json +3 -2
- package/src/i18n/es.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/zh-cn.ts +2 -0
- package/src/i18n/zh-tw.ts +2 -0
- package/src/layout/pane-manager/dock-tree.ts +19 -0
- package/src/layout/pane-manager/index.ts +3 -0
- package/src/market-data/coordinator/index.ts +4 -3
- package/src/market-data/coordinator/quotes.ts +12 -4
- 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 +31 -0
- package/src/market-data/quotes/live-valuation.ts +32 -5
- package/src/market-data/quotes/regular-session-valuation.ts +1 -1
- package/src/market-data/quotes/resolution.ts +4 -0
- package/src/market-data/quotes/time.ts +0 -14
- package/src/plugins/builtin/account-management/index.tsx +1 -0
- package/src/plugins/builtin/awards/detail.tsx +12 -4
- package/src/plugins/builtin/awards/headless.ts +29 -8
- package/src/plugins/builtin/awards/model.ts +36 -2
- package/src/plugins/builtin/awards/pane.tsx +7 -4
- package/src/plugins/builtin/broker-manager/detail.tsx +5 -3
- package/src/plugins/builtin/broker-manager/index.tsx +7 -6
- package/src/plugins/builtin/broker-manager/model.ts +15 -6
- package/src/plugins/builtin/broker-manager/pane-actions.tsx +11 -4
- package/src/plugins/builtin/broker-manager/sign-in-end.ts +50 -19
- package/src/plugins/builtin/broker-manager/table.ts +10 -4
- package/src/plugins/builtin/broker-trading/index.tsx +1 -1
- package/src/plugins/builtin/central-bank-rates/headless.ts +6 -6
- package/src/plugins/builtin/central-bank-rates/index.tsx +1 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +21 -3
- package/src/plugins/builtin/central-bank-rates/pane.tsx +15 -5
- package/src/plugins/builtin/chart-composer/headless.ts +5 -1
- package/src/plugins/builtin/chart-composer/pane.tsx +1 -0
- 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/message/terminal.tsx +4 -1
- package/src/plugins/builtin/chat/sidebar.tsx +35 -19
- package/src/plugins/builtin/cloud/askg/pane.tsx +4 -0
- package/src/plugins/builtin/cloud/askg/tool-timeline.tsx +2 -0
- package/src/plugins/builtin/cloud/plugin.tsx +1 -0
- package/src/plugins/builtin/cloud/team/module.tsx +1 -0
- package/src/plugins/builtin/cloud/thesis/detail.tsx +9 -4
- package/src/plugins/builtin/commodity-balances/pane.tsx +13 -5
- package/src/plugins/builtin/company-kpis/model.ts +3 -3
- package/src/plugins/builtin/connections/index.ts +1 -0
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +9 -5
- package/src/plugins/builtin/credit-boards/client.ts +5 -0
- package/src/plugins/builtin/credit-boards/headless.ts +1 -6
- package/src/plugins/builtin/credit-boards/model.ts +0 -6
- 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/crypto-etf-flows/headless.ts +23 -13
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +8 -3
- package/src/plugins/builtin/debt-maturities/headless.ts +16 -7
- package/src/plugins/builtin/debt-maturities/model.ts +9 -15
- package/src/plugins/builtin/debt-maturities/pane.tsx +9 -10
- package/src/plugins/builtin/earnings/board-model.ts +33 -4
- package/src/plugins/builtin/earnings/board.tsx +15 -3
- package/src/plugins/builtin/earnings/calendar.tsx +10 -6
- package/src/plugins/builtin/earnings/client.ts +0 -9
- package/src/plugins/builtin/earnings/headless.ts +10 -7
- package/src/plugins/builtin/earnings/history.tsx +21 -14
- package/src/plugins/builtin/earnings-calls/data.ts +24 -4
- package/src/plugins/builtin/earnings-calls/format.ts +23 -5
- 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/econ/calendar-model.ts +27 -0
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -0
- package/src/plugins/builtin/econ/index.tsx +9 -2
- package/src/plugins/builtin/econ-statistics/headless.ts +3 -1
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
- package/src/plugins/builtin/equity-screener/live.ts +74 -18
- package/src/plugins/builtin/equity-screener/model.ts +19 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +19 -14
- package/src/plugins/builtin/equity-screener/refresh-anchor.ts +45 -0
- package/src/plugins/builtin/equity-screener/results.ts +22 -2
- package/src/plugins/builtin/equity-screener/screen-check.ts +9 -3
- package/src/plugins/builtin/fear-greed/headless.ts +16 -13
- package/src/plugins/builtin/fear-greed/pane.tsx +12 -4
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/futures/index.tsx +15 -1
- package/src/plugins/builtin/futures/table.tsx +1 -1
- package/src/plugins/builtin/fx-matrix/index.tsx +32 -19
- package/src/plugins/builtin/holders/pane.tsx +30 -20
- package/src/plugins/builtin/insider/table.tsx +10 -7
- package/src/plugins/builtin/insider/tickers.tsx +1 -1
- package/src/plugins/builtin/iv-history/events.ts +5 -0
- package/src/plugins/builtin/iv-history/headless.ts +15 -9
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -0
- package/src/plugins/builtin/macro-day/headless.ts +15 -6
- package/src/plugins/builtin/macro-day/model.ts +1 -1
- package/src/plugins/builtin/macro-day/releases.ts +25 -16
- 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/money-markets/headless.ts +12 -2
- package/src/plugins/builtin/money-markets/pane.tsx +10 -1
- package/src/plugins/builtin/options/view.tsx +3 -0
- package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -31
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +19 -1
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +22 -8
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +6 -8
- package/src/plugins/builtin/portfolio-list/table.tsx +15 -1
- package/src/plugins/builtin/rate-path/pane.tsx +2 -0
- package/src/plugins/builtin/realized-vol/headless.ts +28 -2
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +2 -0
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -1
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- package/src/plugins/builtin/seasonality/pane.tsx +2 -1
- package/src/plugins/builtin/shared/source-footer.ts +70 -0
- package/src/plugins/builtin/short-interest/publications-pane.tsx +5 -1
- package/src/plugins/builtin/short-volume/pane.tsx +5 -1
- 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 +12 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +9 -8
- package/src/plugins/builtin/supply-chain/graph.tsx +12 -6
- package/src/plugins/builtin/supply-chain/headless.ts +13 -7
- package/src/plugins/builtin/supply-chain/model.ts +68 -11
- package/src/plugins/builtin/supply-chain/pane.tsx +9 -6
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +5 -5
- package/src/plugins/builtin/thirteenf/pane.tsx +2 -0
- package/src/plugins/builtin/ticker-detail/financials/model.ts +28 -6
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +26 -9
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +58 -35
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +14 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +2 -0
- 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 +6 -3
- 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/headless.ts +226 -37
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +11 -5
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +27 -25
- package/src/plugins/builtin/treasury-auctions/hk.ts +60 -8
- 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 +100 -22
- package/src/plugins/builtin/treasury-auctions/pane.tsx +39 -11
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +6 -3
- package/src/plugins/builtin/vol-surface/pane.tsx +7 -3
- package/src/plugins/builtin/world-indices/index.tsx +5 -1
- package/src/plugins/builtin/yield-curve/index.tsx +2 -1
- package/src/plugins/runtime/index.tsx +1 -0
- package/src/plugins/runtime/state.ts +20 -0
- package/src/portfolio/column-values.ts +8 -2
- 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/data-table/column-drag.ts +147 -0
- package/src/renderers/dom/data-table/index.tsx +22 -0
- package/src/renderers/dom/data-table/row.tsx +27 -5
- 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 +47 -5
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +2 -1
- package/src/renderers/opentui/chart-surface.tsx +1 -0
- package/src/renderers/opentui/frame-hits.ts +33 -0
- package/src/renderers/opentui/host.tsx +2 -0
- package/src/renderers/opentui/native-surface.ts +14 -21
- package/src/renderers/opentui/test-utils.tsx +3 -0
- 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/normalizers.ts +22 -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/state/app/context/index.tsx +46 -1
- package/src/state/pane-unsent-work.ts +47 -0
- package/src/test-support/app-store.ts +24 -1
- 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/listing-venues.ts +11 -1
- package/src/tickers/search/japanese-names.json +1 -0
- package/src/tickers/search/japanese-names.ts +152 -0
- package/src/tickers/terminal-codes.ts +55 -6
- package/src/time-series/base-series.ts +3 -0
- package/src/time-series/live-quotes.ts +3 -9
- package/src/types/data-provider.ts +6 -0
- package/src/types/financials.ts +11 -0
- package/src/types/plugin-contributions.ts +7 -0
- package/src/types/plugin-panes.ts +7 -0
- package/src/ui/host.tsx +24 -0
- package/src/ui/pointer-drag.ts +11 -2
- package/src/utils/double-escape-close.ts +42 -0
- package/src/utils/fundamentals.ts +14 -3
- package/src/utils/fx-status.ts +30 -7
- package/src/utils/network-failure.ts +23 -0
- package/src/utils/share-multiples.cases.json +780 -2
- package/src/utils/share-multiples.ts +154 -24
|
@@ -13,7 +13,12 @@ import { formatPercentileRank } from "../../../utils/format";
|
|
|
13
13
|
import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
14
14
|
import { useResearchCloudSession } from "../shared/research-cloud-session";
|
|
15
15
|
import { getCachedCentralBankRates, loadCentralBankRates } from "./client";
|
|
16
|
-
import {
|
|
16
|
+
import { centralBankRatesHeadless } from "./headless";
|
|
17
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
18
|
+
import {
|
|
19
|
+
hasNoPolicyRate, policyBoardRow, policyChange, policyChangeDate, policyHistory, policyLevel, policyNotices, policyObservations, policyRate,
|
|
20
|
+
policySource,
|
|
21
|
+
} from "./model";
|
|
17
22
|
|
|
18
23
|
const PANELS = [{ id: "main" }];
|
|
19
24
|
|
|
@@ -22,12 +27,15 @@ function PolicyDetail({ row, width, height, focused }: { row: CentralBankRow; wi
|
|
|
22
27
|
const series = useMemo(() => [staticSeries(history.map((point) => ({ date: new Date(point.date), observedAt: new Date(point.date), value: point.value })),
|
|
23
28
|
{ id: row.id, label: row.instrument, color: colors.positive, calendarSpaced: true, style: "step" })], [row, history]);
|
|
24
29
|
const p = row.percentile;
|
|
30
|
+
// A bank whose terms ask it: the figures computed from its rates say so (the CBE's).
|
|
31
|
+
const computed = row.computedFrom ? `computed from ${row.computedFrom}` : null;
|
|
25
32
|
// The chart shows the rank window, so the range carries no window or sample
|
|
26
33
|
// count; short details keep the figures several to a row.
|
|
27
34
|
const items: StatItem[] = [
|
|
28
35
|
{ id: "level", label: row.range ? "Target range" : "Policy rate", value: policyLevel(row),
|
|
29
|
-
detail: formatPercentileRank(p.value, "1Y") },
|
|
30
|
-
{ id: "move", label: "Last change", value: policyChange(row),
|
|
36
|
+
detail: [formatPercentileRank(p.value, "1Y"), computed].filter(Boolean).join(" · ") },
|
|
37
|
+
{ id: "move", label: "Last change", value: policyChange(row),
|
|
38
|
+
detail: [policyChangeDate(row), computed].filter(Boolean).join(" · ") || undefined },
|
|
31
39
|
// A target range ranks and charts its midpoint, which the band's range would not say.
|
|
32
40
|
{ id: "range", label: "1Y range", value: `${policyRate(p.min)} to ${policyRate(p.max)}`, detail: row.range ? "midpoint" : undefined },
|
|
33
41
|
{ id: "asOf", label: "As of", value: row.asOf ?? "--", tone: row.status === "stale" ? "warning" : undefined,
|
|
@@ -38,7 +46,7 @@ function PolicyDetail({ row, width, height, focused }: { row: CentralBankRow; wi
|
|
|
38
46
|
...row.latestDecision === undefined ? [] : [{ id: "decided", label: row.latestDecision?.kind === "fixing" ? "Last fixing" : "Last decision",
|
|
39
47
|
value: row.latestDecision?.date ?? "--" }],
|
|
40
48
|
{ id: "meeting", label: row.nextMeeting?.kind === "fixing" ? "Next fixing" : "Next meeting", value: row.nextMeeting?.date ?? "--" },
|
|
41
|
-
{ id: "source", label: "Source", value: row
|
|
49
|
+
{ id: "source", label: "Source", value: policySource(row) ?? "--", detail: row.sourceSeriesIds.join(", ") || undefined },
|
|
42
50
|
{ id: "instrument", label: "Instrument", value: row.instrument, detail: row.centralBank ?? undefined, wide: true },
|
|
43
51
|
];
|
|
44
52
|
return <StatChartDetail items={items} width={width} height={height} empty={!history.some((point) => point.value != null)}
|
|
@@ -63,7 +71,9 @@ export function CentralBankRatesPane({ width, height, focused }: PaneProps) {
|
|
|
63
71
|
notices: [...(data ? policyNotices(data) : []), ...(resource.data?.refreshError ? [resource.data.refreshError] : [])] });
|
|
64
72
|
usePaneStatusLinkFooter({ registrationId: "central-bank-rates", focused, loading: resource.loading, error: resource.error,
|
|
65
73
|
url: selected?.observation.sourceUrl ?? null, showOpenHint: true,
|
|
66
|
-
|
|
74
|
+
// Its sources and the rows' dates, as `fn CBR` ends; how long ago it loaded goes first on a narrow row.
|
|
75
|
+
info: data ? [reportFooterSegment(centralBankRatesHeadless, { sections: [], freshness: { observations: policyObservations(data) } }),
|
|
76
|
+
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : [])] : [],
|
|
67
77
|
stale: !!data && resource.data?.stale,
|
|
68
78
|
});
|
|
69
79
|
return <Box width={width} height={height} flexDirection="column">
|
|
@@ -346,13 +346,17 @@ function releaseDay(value: unknown): string | null {
|
|
|
346
346
|
* Who a chart cites when each of its series names its own dataset (CBR's
|
|
347
347
|
* policy rates: `FRED series ECBDFR`); nothing, so Gloom Cloud, otherwise.
|
|
348
348
|
*/
|
|
349
|
-
function seriesAttribution(series: readonly HeadlessSeries[]): Pick<HeadlessPaneFreshness, "source" | "publisher"> {
|
|
349
|
+
function seriesAttribution(series: readonly HeadlessSeries[]): Pick<HeadlessPaneFreshness, "source" | "publisher" | "publishedAt"> {
|
|
350
350
|
const cited = series.map((entry) => (entry as HeadlessSeries & Pick<ResolvedSeries, "attribution">).attribution);
|
|
351
351
|
if (!cited.length || cited.some((attribution) => !attribution)) return {};
|
|
352
352
|
const publishers = [...new Set(cited.map((attribution) => attribution!.publisher))];
|
|
353
|
+
// The chart was published with its last series: the newest publication, when every series says when.
|
|
354
|
+
const published = cited.map((attribution) => attribution!.publishedAt);
|
|
355
|
+
const publishedAt = published.every(Boolean) ? (published as string[]).sort().at(-1) : undefined;
|
|
353
356
|
return {
|
|
354
357
|
source: [...new Set(cited.map((attribution) => attribution!.source))].join(", "),
|
|
355
358
|
...(publishers.every(Boolean) ? { publisher: publishers.join(", ") } : {}),
|
|
359
|
+
...(publishedAt ? { publishedAt } : {}),
|
|
356
360
|
};
|
|
357
361
|
}
|
|
358
362
|
|
|
@@ -1313,6 +1313,7 @@ function ChartComposerSurface({
|
|
|
1313
1313
|
...totalReturnFilters,
|
|
1314
1314
|
]}
|
|
1315
1315
|
view={resolutionOptions.length > 1 ? {
|
|
1316
|
+
label: "Interval",
|
|
1316
1317
|
value: spec.viewport.resolution,
|
|
1317
1318
|
options: resolutionOptions,
|
|
1318
1319
|
onChange: (value: string) => setResolution(value as ChartResolution),
|
|
@@ -8,6 +8,7 @@ import { useShortcut } from "../../../../react/input";
|
|
|
8
8
|
import { blendHex, colors } from "../../../../theme/colors";
|
|
9
9
|
import { Box, Text, TextAttributes, type InputRenderable } from "../../../../ui";
|
|
10
10
|
import { countEscapeTowardClose } from "../../../../utils/double-escape-close";
|
|
11
|
+
import { usePaneUnsentWork } from "../../../../state/pane-unsent-work";
|
|
11
12
|
import { displayWidth } from "../../../../utils/format";
|
|
12
13
|
import { truncateWithEllipsis } from "../../../../utils/text-wrap";
|
|
13
14
|
import {
|
|
@@ -213,6 +214,9 @@ export function ChatHandlePrompt({
|
|
|
213
214
|
menu: [{ id: "handle-not-now", label: t("Hide Handle Prompt"), onSelect: onDismiss }],
|
|
214
215
|
} : null), [onDismiss, onFocusField, prompt.saving, prompt.visible]);
|
|
215
216
|
|
|
217
|
+
// A handle typed and not saved goes with the pane: Esc never closes it over one.
|
|
218
|
+
usePaneUnsentWork(prompt.visible && !prompt.saving && normalizeHandleInput(prompt.value).length > 0);
|
|
219
|
+
|
|
216
220
|
useShortcut((event) => {
|
|
217
221
|
if (event.name !== "escape") return;
|
|
218
222
|
event.preventDefault?.();
|
|
@@ -27,7 +27,17 @@ interface ChatControllerRealtimeOptions {
|
|
|
27
27
|
invalidateMentionCandidates: () => void;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* After a drop, the full-page reads wait a random moment up to this long. A
|
|
32
|
+
* server restart reconnects every client within about two seconds and each
|
|
33
|
+
* reads a page per channel it shows; spread out, they reach the server as a
|
|
34
|
+
* trickle. Only reactions, edits and removals made during the drop wait for
|
|
35
|
+
* it: the catch-up reads new messages as soon as the socket is back.
|
|
36
|
+
*/
|
|
37
|
+
const CHAT_RESYNC_SPREAD_MS = 3_000;
|
|
38
|
+
|
|
30
39
|
export class ChatControllerRealtime {
|
|
40
|
+
private resyncTimer: ReturnType<typeof setTimeout> | null = null;
|
|
31
41
|
private verificationPollTimer: ReturnType<typeof setInterval> | null = null;
|
|
32
42
|
private sessionRetryTimer: ReturnType<typeof setTimeout> | null = null;
|
|
33
43
|
private safetyRefreshTimer: ReturnType<typeof setInterval> | null = null;
|
|
@@ -114,12 +124,18 @@ export class ChatControllerRealtime {
|
|
|
114
124
|
}
|
|
115
125
|
if (!dropped) return;
|
|
116
126
|
dropped = false;
|
|
117
|
-
this.
|
|
127
|
+
if (this.resyncTimer) return;
|
|
128
|
+
this.resyncTimer = setTimeout(() => {
|
|
129
|
+
this.resyncTimer = null;
|
|
130
|
+
this.options.resyncChannels();
|
|
131
|
+
}, Math.random() * CHAT_RESYNC_SPREAD_MS);
|
|
118
132
|
});
|
|
119
133
|
}
|
|
120
134
|
}
|
|
121
135
|
|
|
122
136
|
stopRealtimeSubscriptions(): void {
|
|
137
|
+
if (this.resyncTimer) clearTimeout(this.resyncTimer);
|
|
138
|
+
this.resyncTimer = null;
|
|
123
139
|
this.mentionCandidatesUnsubscribe?.();
|
|
124
140
|
this.mentionCandidatesUnsubscribe = null;
|
|
125
141
|
this.socketConnectionUnsubscribe?.();
|
|
@@ -8,6 +8,7 @@ import { ChatBotIcon } from "./person-icons";
|
|
|
8
8
|
import { CHAT_PERSON_ICON_WIDTH } from "../people";
|
|
9
9
|
import { ChatMessageActions, ChatMessageHeader } from "./header";
|
|
10
10
|
import { Button } from "../../../../components/ui";
|
|
11
|
+
import { useSelectionFill } from "../../../../components/ui/selection-fill";
|
|
11
12
|
import { canReactToMessage } from "../reactions";
|
|
12
13
|
import { TerminalChatReactions } from "./reactions";
|
|
13
14
|
import { TerminalChatMessageRow } from "./inline-tokens";
|
|
@@ -54,6 +55,7 @@ export function TerminalChatMessage({
|
|
|
54
55
|
}: TerminalChatMessageProps) {
|
|
55
56
|
const rendererHost = useRendererHost();
|
|
56
57
|
const slowSend = useSlowPendingSend(msg);
|
|
58
|
+
const selectionFill = useSelectionFill();
|
|
57
59
|
const canReact = reactionsEnabled && canReactToMessage(msg);
|
|
58
60
|
const state = getChatMessageRenderState({
|
|
59
61
|
msg,
|
|
@@ -92,7 +94,8 @@ export function TerminalChatMessage({
|
|
|
92
94
|
const clearHovered = () => setHoveredIdx((current) => (current === index ? null : current));
|
|
93
95
|
const messageRowProps = {
|
|
94
96
|
width: contentWidth,
|
|
95
|
-
|
|
97
|
+
// The chosen message is quieter while the chat pane does not have the keys.
|
|
98
|
+
backgroundColor: state.isSelected ? selectionFill.bg : state.bgColor,
|
|
96
99
|
onMouseOver: setHovered,
|
|
97
100
|
onMouseOut: clearHovered,
|
|
98
101
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ActionRow } from "../../../components/ui/action-row";
|
|
2
2
|
import { Icon } from "../../../components/ui/icon";
|
|
3
|
-
import { useMemo, useSyncExternalStore } from "react";
|
|
3
|
+
import { useMemo, useRef, useSyncExternalStore, type ReactNode } from "react";
|
|
4
4
|
import {
|
|
5
5
|
getPaneSidebarWidthRange,
|
|
6
6
|
PaneSidebar,
|
|
@@ -8,9 +8,10 @@ import {
|
|
|
8
8
|
PaneSidebarList,
|
|
9
9
|
PaneSidebarRow,
|
|
10
10
|
} from "../../../components";
|
|
11
|
-
import {
|
|
11
|
+
import { usePaneSidebarReveal } from "../../../components/layout/pane/sidebar";
|
|
12
|
+
import { Box, Span, Text, useUiCapabilities, type BoxRenderable } from "../../../ui";
|
|
12
13
|
import { TextAttributes } from "../../../ui";
|
|
13
|
-
import {
|
|
14
|
+
import { colors } from "../../../theme/colors";
|
|
14
15
|
import { t } from "../../../i18n";
|
|
15
16
|
import type { ChatChannel } from "../../../api-client";
|
|
16
17
|
import { truncateWithEllipsis } from "../../../utils/text-wrap";
|
|
@@ -65,6 +66,22 @@ function ChannelNotificationIcon({
|
|
|
65
66
|
);
|
|
66
67
|
}
|
|
67
68
|
|
|
69
|
+
/** A section's header, kept in view while the keyboard's cursor is on it. */
|
|
70
|
+
function SectionHeaderRow({ width, cursor, backgroundColor, children }: {
|
|
71
|
+
width: number;
|
|
72
|
+
cursor: boolean;
|
|
73
|
+
backgroundColor: string;
|
|
74
|
+
children: ReactNode;
|
|
75
|
+
}) {
|
|
76
|
+
const ref = useRef<BoxRenderable>(null);
|
|
77
|
+
usePaneSidebarReveal(ref, cursor);
|
|
78
|
+
return (
|
|
79
|
+
<Box ref={ref} height={1} width={width} flexDirection="row" backgroundColor={backgroundColor}>
|
|
80
|
+
{children}
|
|
81
|
+
</Box>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
68
85
|
function ProfileIcon({
|
|
69
86
|
color,
|
|
70
87
|
onMouseDown,
|
|
@@ -182,13 +199,11 @@ export function ChannelSidebar({
|
|
|
182
199
|
onResizeEnd: (nextWidth) => chatSidebarStore.commitWidth(nextWidth),
|
|
183
200
|
} : undefined}
|
|
184
201
|
>
|
|
185
|
-
{({ backgroundColor: sidebarBg, listWidth }) => {
|
|
186
|
-
|
|
187
|
-
// The fill a keyboard-focused sidebar gives the row under its cursor.
|
|
188
|
-
const cursorBackground = blendHex(colors.selected, colors.borderFocused, 0.32);
|
|
202
|
+
{({ backgroundColor: sidebarBg, listWidth: sidebarWidth, activeBackgroundColor: cursorBackground }) => {
|
|
203
|
+
// A heading under the cursor takes the fill the sidebar's own rows take there.
|
|
189
204
|
// Every section reads the same: a caret, a label, and an optional
|
|
190
205
|
// trailing action, so their channels can all share one indent.
|
|
191
|
-
const sectionHeader = ({ key, label, fg, unread, expanded, onToggle, action }: {
|
|
206
|
+
const sectionHeader = (listWidth: number, { key, label, fg, unread, expanded, onToggle, action }: {
|
|
192
207
|
key: string;
|
|
193
208
|
label: string;
|
|
194
209
|
fg?: string;
|
|
@@ -198,13 +213,13 @@ export function ChannelSidebar({
|
|
|
198
213
|
action?: { ariaLabel: string; onPress: () => void };
|
|
199
214
|
}) => {
|
|
200
215
|
const rowWidth = Math.max(1, listWidth - (action ? SECTION_ACTION_WIDTH : 0));
|
|
216
|
+
const cursor = keyboardFocused && cursorHeaderKey === key;
|
|
201
217
|
return (
|
|
202
|
-
<
|
|
218
|
+
<SectionHeaderRow
|
|
203
219
|
key={key}
|
|
204
|
-
height={1}
|
|
205
220
|
width={listWidth}
|
|
206
|
-
|
|
207
|
-
backgroundColor={
|
|
221
|
+
cursor={cursor}
|
|
222
|
+
backgroundColor={cursor ? cursorBackground : sidebarBg}
|
|
208
223
|
>
|
|
209
224
|
<ActionRow
|
|
210
225
|
label={truncateWithEllipsis(label, Math.max(1, rowWidth - CHANNEL_ROW_INDENT))}
|
|
@@ -225,15 +240,16 @@ export function ChannelSidebar({
|
|
|
225
240
|
)}
|
|
226
241
|
</PaneSidebarAction>
|
|
227
242
|
) : null}
|
|
228
|
-
</
|
|
243
|
+
</SectionHeaderRow>
|
|
229
244
|
);
|
|
230
245
|
};
|
|
231
246
|
return (
|
|
232
247
|
<>
|
|
233
248
|
<PaneSidebarList>
|
|
234
|
-
{sidebarRows.map((row) => {
|
|
249
|
+
{({ listWidth }) => sidebarRows.map((row) => {
|
|
250
|
+
const labelWidth = Math.max(listWidth - CHANNEL_ROW_INDENT - notificationWidth, 1);
|
|
235
251
|
if (row.kind === "public-header") {
|
|
236
|
-
return sectionHeader({
|
|
252
|
+
return sectionHeader(listWidth, {
|
|
237
253
|
key: row.key,
|
|
238
254
|
label: "Channels",
|
|
239
255
|
unread: hasUnread(row.channels),
|
|
@@ -243,7 +259,7 @@ export function ChannelSidebar({
|
|
|
243
259
|
}
|
|
244
260
|
if (row.kind === "team-header") {
|
|
245
261
|
const canAddChannel = !!row.team && !!onCreateTeamChannel;
|
|
246
|
-
return sectionHeader({
|
|
262
|
+
return sectionHeader(listWidth, {
|
|
247
263
|
key: row.key,
|
|
248
264
|
label: row.team ? `${teamPrefix(row.team)} ${row.team.name}` : "Team",
|
|
249
265
|
fg: row.team ? teamAccentHex(row.team.accentColor) : colors.textDim,
|
|
@@ -259,7 +275,7 @@ export function ChannelSidebar({
|
|
|
259
275
|
});
|
|
260
276
|
}
|
|
261
277
|
if (row.kind === "direct-header") {
|
|
262
|
-
return sectionHeader({
|
|
278
|
+
return sectionHeader(listWidth, {
|
|
263
279
|
key: row.key,
|
|
264
280
|
label: "DMs",
|
|
265
281
|
unread: hasUnread(row.channels),
|
|
@@ -325,7 +341,7 @@ export function ChannelSidebar({
|
|
|
325
341
|
<Text fg={foregroundColor} selectable={false} onMouseDown={onMouseDown}> </Text>
|
|
326
342
|
<ProfileIcon color={foregroundColor} onMouseDown={onMouseDown} />
|
|
327
343
|
<Text fg={foregroundColor} selectable={false} onMouseDown={onMouseDown}>
|
|
328
|
-
{` ${truncateWithEllipsis(t("Profile"), Math.max(
|
|
344
|
+
{` ${truncateWithEllipsis(t("Profile"), Math.max(sidebarWidth - 3, 1))}`}
|
|
329
345
|
</Text>
|
|
330
346
|
<Box flexGrow={1} onMouseDown={onMouseDown} />
|
|
331
347
|
</>
|
|
@@ -333,7 +349,7 @@ export function ChannelSidebar({
|
|
|
333
349
|
</PaneSidebarRow>
|
|
334
350
|
)}
|
|
335
351
|
{loading && focused && (
|
|
336
|
-
<Box height={1} width={
|
|
352
|
+
<Box height={1} width={sidebarWidth} flexDirection="row">
|
|
337
353
|
<Text fg={colors.textDim}>{` ${t("syncing")}`}</Text>
|
|
338
354
|
</Box>
|
|
339
355
|
)}
|
|
@@ -44,6 +44,7 @@ import {
|
|
|
44
44
|
usePaneAppConfig,
|
|
45
45
|
} from "../../../../state/app/context";
|
|
46
46
|
import { usePaneSession, usePaneSessionState } from "../../../../state/pane-session";
|
|
47
|
+
import { usePaneUnsentWork } from "../../../../state/pane-unsent-work";
|
|
47
48
|
import { useInlineTickers } from "../../../../state/hooks/inline-tickers";
|
|
48
49
|
import { useRemoteControlHandler } from "../../../../remote/app-host";
|
|
49
50
|
import { RemoteUiScope } from "../../../../remote/semantic-tree";
|
|
@@ -694,6 +695,9 @@ export function ASKGPane({ paneId, focused, width, height }: PaneProps) {
|
|
|
694
695
|
: getPaneSidebarWidth(width, !!nativePaneChrome, conversations.width);
|
|
695
696
|
|
|
696
697
|
const running = isTurnRunning(state);
|
|
698
|
+
// The draft lives only as long as the pane does, and an answer coming in
|
|
699
|
+
// would be cut off: Esc never closes the pane over either.
|
|
700
|
+
usePaneUnsentWork(running || inputValue.trim().length > 0, paneId);
|
|
697
701
|
const confirmation = pendingConfirmation(state);
|
|
698
702
|
// A tool's approval goes first; the pane's question waits behind it.
|
|
699
703
|
const paneConsentPending = attached?.consent === "pending" && !confirmation;
|
|
@@ -386,6 +386,8 @@ export function ToolResultDetail({
|
|
|
386
386
|
rootWidth={width}
|
|
387
387
|
rootHeight={Math.max(3, height - headerHeight)}
|
|
388
388
|
columns={columns}
|
|
389
|
+
// A tool's answer, read once: its columns are the tool's, not a layout to keep with the pane.
|
|
390
|
+
columnReorder={false}
|
|
389
391
|
items={table.rows}
|
|
390
392
|
sortColumnId={null}
|
|
391
393
|
sortDirection="asc"
|
|
@@ -105,6 +105,7 @@ const askgModule: PluginModule = {
|
|
|
105
105
|
component: ASKGPane,
|
|
106
106
|
defaultPosition: "right",
|
|
107
107
|
defaultMode: "floating",
|
|
108
|
+
utilityWindow: true,
|
|
108
109
|
defaultFloatingSize: { width: 96, height: 32 },
|
|
109
110
|
portableShare: {
|
|
110
111
|
// A conversation and the panes it read are personal to the account.
|
|
@@ -31,6 +31,7 @@ export const teamModule: PluginModule = {
|
|
|
31
31
|
component: TeamPane,
|
|
32
32
|
defaultPosition: "right",
|
|
33
33
|
defaultMode: "floating",
|
|
34
|
+
utilityWindow: true,
|
|
34
35
|
defaultFloatingSize: { width: 84, height: 30 },
|
|
35
36
|
portableShare: {
|
|
36
37
|
private: { title: true, params: true, settings: true, state: true },
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
import { promptChoice } from "./prompts";
|
|
33
33
|
import { thesisStore } from "./store";
|
|
34
34
|
import { ClippedText } from "../../../../components/ui/display";
|
|
35
|
+
import { useSelectionFill } from "../../../../components/ui/selection-fill";
|
|
35
36
|
import { logFailure } from "../../../../utils/log-failure";
|
|
36
37
|
|
|
37
38
|
type Row =
|
|
@@ -155,6 +156,7 @@ export function ThesisDetail({ thesis, width, height, focused, footerId, onDelet
|
|
|
155
156
|
const [busy, setBusy] = useState(false);
|
|
156
157
|
const generation = useRef(0);
|
|
157
158
|
const { nativePaneChrome } = useUiCapabilities();
|
|
159
|
+
const selectionFill = useSelectionFill();
|
|
158
160
|
|
|
159
161
|
const ctx = useMemo<flows.FlowContext>(() => ({ dialog, notify, hasProAccess: plan.hasProAccess, openUpgrade }), [dialog, notify, openUpgrade, plan.hasProAccess]);
|
|
160
162
|
|
|
@@ -355,8 +357,11 @@ export function ThesisDetail({ thesis, width, height, focused, footerId, onDelet
|
|
|
355
357
|
const renderRow = useCallback((item: ListViewItem, state: { selected: boolean }) => {
|
|
356
358
|
const row = rows.find((entry) => entry.id === item.id);
|
|
357
359
|
if (!row) return null;
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
+
const lit = state.selected && selectionFill.lit;
|
|
361
|
+
// On the quieter fill a row's colours are lifted where they would not read.
|
|
362
|
+
const ink = (color: string) => (state.selected ? selectionFill.ink(color) : color);
|
|
363
|
+
const fg = lit ? colors.selectedText : ink(colors.text);
|
|
364
|
+
const dim = lit ? colors.selectedText : ink(colors.textDim);
|
|
360
365
|
// Every row is a full-width row box, so the DOM host lays headings and
|
|
361
366
|
// prose out flush left like the pillar rows instead of centering them.
|
|
362
367
|
if (row.kind === "heading") {
|
|
@@ -427,7 +432,7 @@ export function ThesisDetail({ thesis, width, height, focused, footerId, onDelet
|
|
|
427
432
|
<Text fg={dim}>{rightText}</Text>
|
|
428
433
|
</Box>
|
|
429
434
|
);
|
|
430
|
-
}, [contentWidth, rows, thesis.document]);
|
|
435
|
+
}, [contentWidth, rows, selectionFill.lit, thesis.document]);
|
|
431
436
|
|
|
432
437
|
const owner = isTeam ? teamStore.getTeam(thesis.owner.id)?.name ?? "team" : null;
|
|
433
438
|
const nextDue = thesis.document.catalysts
|
|
@@ -519,7 +524,7 @@ export function ThesisDetail({ thesis, width, height, focused, footerId, onDelet
|
|
|
519
524
|
rowGap={0}
|
|
520
525
|
height={nativePaneChrome ? undefined : Math.max(3, height - headerHeight - stripHeight)}
|
|
521
526
|
flexGrow={nativePaneChrome ? 1 : undefined}
|
|
522
|
-
getRowBackgroundColor={(item, state) => (state.selected ?
|
|
527
|
+
getRowBackgroundColor={(item, state) => (state.selected ? selectionFill.bg : item.disabled ? colors.bg : undefined)}
|
|
523
528
|
remoteRole="thesis"
|
|
524
529
|
remoteLabel={thesis.title}
|
|
525
530
|
/>
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
12
12
|
import { ageFooterSegment, type PaneFooterSegment } from "../../../components/layout/pane/footer";
|
|
13
13
|
import { useAsyncResource } from "../../../react/async-resource";
|
|
14
|
-
import { useAutoRefresh, useUpdatedAgo } from "../../../react/auto-refresh";
|
|
14
|
+
import { useAutoRefresh, useUpdatedAgo, useUtcDay } from "../../../react/auto-refresh";
|
|
15
15
|
import { usePaneInstance } from "../../../state/app/context";
|
|
16
16
|
import { useThemeColors } from "../../../theme/theme-context";
|
|
17
17
|
import type { PaneProps } from "../../../types/plugin";
|
|
@@ -20,6 +20,8 @@ import { withCountryFlag, withFlagRoom } from "../../../components/ui/country-fl
|
|
|
20
20
|
import { nextHeaderSort } from "../../../utils/sort-values";
|
|
21
21
|
import { usePluginPaneState } from "../../runtime";
|
|
22
22
|
import { fetchCommodityBalances } from "./client";
|
|
23
|
+
import { commodityBalancesHeadless } from "./headless";
|
|
24
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
23
25
|
import {
|
|
24
26
|
BALANCE_SORT,
|
|
25
27
|
PRICE_SORT,
|
|
@@ -94,11 +96,17 @@ export function CommodityBalancesPane({ width, height, focused }: PaneProps) {
|
|
|
94
96
|
queryBarWidth: width,
|
|
95
97
|
});
|
|
96
98
|
const updatedAgo = useUpdatedAgo(updatedAt);
|
|
99
|
+
const utcDay = useUtcDay();
|
|
100
|
+
// Its source and the estimates' month, as `fn PSD` ends; how long ago it loaded goes first on a narrow row.
|
|
97
101
|
const info = useMemo<PaneFooterSegment[]>(() => {
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
+
if (!data) return [];
|
|
103
|
+
const year = data.marketYear;
|
|
104
|
+
return [
|
|
105
|
+
reportFooterSegment(commodityBalancesHeadless, { sections: [], ...(data.month ? { metadata: { asOf: `${data.month}-01` } } : {}) }),
|
|
106
|
+
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
|
|
107
|
+
...(year ? [{ id: "year", parts: [{ text: year, tone: "muted" as const }] }] : []),
|
|
108
|
+
];
|
|
109
|
+
}, [data, updatedAgo, utcDay]);
|
|
102
110
|
|
|
103
111
|
useAutoRefresh(updatedAt, load);
|
|
104
112
|
usePaneRefreshKey(load, { focused });
|
|
@@ -282,8 +282,8 @@ export function fitCompanyColumns(columns: readonly DataTableColumn[], width: nu
|
|
|
282
282
|
const EXAMPLE_COMPANIES: Record<CompanyMode, readonly string[]> = { guidance: ["WMT", "DAL"], kpis: ["AAPL", "NVDA"] };
|
|
283
283
|
|
|
284
284
|
/**
|
|
285
|
-
* What an empty table says. A company with nothing on file for the function
|
|
286
|
-
*
|
|
285
|
+
* What an empty table says. A company with nothing on file for the function reads as
|
|
286
|
+
* not yet available, never as an error, and names one that has some; a selection or tab that narrows what the company
|
|
287
287
|
* has says what is missing from it. `cli` types `fn GUIDE WMT`, the app's command bar `GUIDE WMT`.
|
|
288
288
|
*/
|
|
289
289
|
export function companyEmptyState(mode: CompanyMode, symbol: string, view: { tab: string; hasRows: boolean }, surface: "cli" | "pane" = "pane"): { title: string; hint?: string } {
|
|
@@ -291,7 +291,7 @@ export function companyEmptyState(mode: CompanyMode, symbol: string, view: { tab
|
|
|
291
291
|
const examples = EXAMPLE_COMPANIES[mode];
|
|
292
292
|
const example = examples.find((candidate) => candidate !== symbol.trim().toUpperCase()) ?? examples[0]!;
|
|
293
293
|
const command = `${mode === "kpis" ? "KPIS" : "GUIDE"} ${example}`;
|
|
294
|
-
return { title:
|
|
294
|
+
return { title: mode === "kpis" ? `KPIs for ${symbol} are not yet available.` : `Guidance for ${symbol} is not yet available.`, hint: `Try ${surface === "cli" ? `\`fn ${command}\`` : command}.` };
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
/** What a missing KPI means, as KPIS states it among its limitations and EQS beside a KPI column with gaps. */
|
|
@@ -38,6 +38,7 @@ export const connectionsModule: PluginModule = {
|
|
|
38
38
|
reportFreshness: { status: "not-a-feed", basis: "connection health", local: true },
|
|
39
39
|
defaultPosition: "right",
|
|
40
40
|
defaultMode: "floating",
|
|
41
|
+
utilityWindow: true,
|
|
41
42
|
defaultFloatingSize: { width: 80, height: 24 },
|
|
42
43
|
portableShare: {
|
|
43
44
|
private: { params: true, settings: true, state: true },
|
|
@@ -21,7 +21,9 @@ import type { PaneProps } from "../../../types/plugin";
|
|
|
21
21
|
import { usePluginPaneState } from "../../runtime";
|
|
22
22
|
import { FIXED_INCOME_PANE_ID } from "../fixed-income/model";
|
|
23
23
|
import { useCommandValue } from "../shared/command-tab";
|
|
24
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
24
25
|
import { getCachedCdxBoard, loadCdxBoard } from "./client";
|
|
26
|
+
import { cdxHeadless } from "./headless";
|
|
25
27
|
import {
|
|
26
28
|
axisFormatter,
|
|
27
29
|
cdxRows,
|
|
@@ -30,7 +32,6 @@ import {
|
|
|
30
32
|
formatLevel,
|
|
31
33
|
formatMove,
|
|
32
34
|
formatSpreadRank,
|
|
33
|
-
newestRowDate,
|
|
34
35
|
partialDayText,
|
|
35
36
|
SETTLEMENT_TEXT,
|
|
36
37
|
type CdxRow,
|
|
@@ -110,13 +111,16 @@ export function CdxPane({ focused, width, height }: PaneProps) {
|
|
|
110
111
|
useAutoRefresh(resource.updatedAt, refresh);
|
|
111
112
|
usePaneRefreshKey(reload, { focused, enabled: !loading });
|
|
112
113
|
|
|
113
|
-
//
|
|
114
|
-
|
|
114
|
+
// Its source and the newest day the rows carry, not when the response was put together, as `fn CDX` ends.
|
|
115
|
+
// The clock says the prints are delayed, so the line does not again.
|
|
116
|
+
const sourceLine = useMemo(() => payload
|
|
117
|
+
? reportFooterSegment(cdxHeadless, { sections: [{ title: "", columns: [], rows: payload.indexes.map((index) => ({ date: index.date })) }] }, { feed: false })
|
|
118
|
+
: null, [payload]);
|
|
115
119
|
// PCTL 1Y ranks spreads; the rows quoted in price (HY, EM) rank their spread equivalent, which a picture keeps.
|
|
116
120
|
const spreadEqRanked = useMemo(() => rows.filter((row) => row.rank.basis === "spread-eq")
|
|
117
121
|
.map((row) => row.index.name.replace(/^CDX\s+/i, "")).join(", "), [rows]);
|
|
118
122
|
const info = useMemo<PaneFooterSegment[]>(() => [
|
|
119
|
-
...(
|
|
123
|
+
...(sourceLine ? [sourceLine] : []),
|
|
120
124
|
...(payload ? [DELAYED_SEGMENT] : []),
|
|
121
125
|
...(resource.data?.stale ? [{ id: "stale", parts: [{ text: "STALE", tone: "warning" as const }] }] : []),
|
|
122
126
|
...(spreadEqRanked ? [{
|
|
@@ -124,7 +128,7 @@ export function CdxPane({ focused, width, height }: PaneProps) {
|
|
|
124
128
|
parts: [{ text: `${spreadEqRanked} pctl on spread eq`, tone: "muted" as const }],
|
|
125
129
|
variants: [[{ text: "pctl on spread eq", tone: "muted" as const }]],
|
|
126
130
|
}] : []),
|
|
127
|
-
], [
|
|
131
|
+
], [payload, sourceLine, resource.data?.stale, spreadEqRanked]);
|
|
128
132
|
usePaneStatusFooter({
|
|
129
133
|
registrationId: "cdx",
|
|
130
134
|
loading,
|
|
@@ -63,6 +63,11 @@ type BoardClient = Pick<typeof apiClient, "getCloudCdxBoard" | "getCloudSovrBoar
|
|
|
63
63
|
/** Days of history the server serves at most, for a history export. */
|
|
64
64
|
export const CDX_MAX_DAYS = 1100;
|
|
65
65
|
|
|
66
|
+
/** The publisher a board's payload names, spelled out: `DTCC PPD` is DTCC's public price dissemination. */
|
|
67
|
+
export function boardPublisher(source: string | null | undefined): string | undefined {
|
|
68
|
+
return source?.trim().replace(/\bPPD\b/, "Public Price Dissemination") || undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
66
71
|
export async function fetchCdxBoard(client: BoardClient = apiClient, days = BOARD_DAYS): Promise<CdxBoardPayload> {
|
|
67
72
|
try { return validateCdxBoard(await client.getCloudCdxBoard({ days })); }
|
|
68
73
|
catch (error) { throw unavailableOnServer(error, "Index CDS levels are not available yet."); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HeadlessPaneColumn, HeadlessPaneDefinition, HeadlessPaneRow } from "../../../types/plugin";
|
|
2
2
|
import type { CdxBoardIndex, CreditIndexQuote } from "../../../api-client/credit-boards";
|
|
3
|
-
import { CDX_MAX_DAYS, fetchCdxBoard, fetchSovrBoard, loadCurrencyMoves } from "./client";
|
|
3
|
+
import { boardPublisher, CDX_MAX_DAYS, fetchCdxBoard, fetchSovrBoard, loadCurrencyMoves } from "./client";
|
|
4
4
|
import { readsInBatches } from "../../../market-data/batched-reads";
|
|
5
5
|
import {
|
|
6
6
|
cdxDay,
|
|
@@ -55,11 +55,6 @@ const dayColumn: HeadlessPaneColumn = {
|
|
|
55
55
|
format: (value) => typeof value === "string" ? value : "",
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
/** The publisher a board's payload names, spelled out: `DTCC PPD` is DTCC's public price dissemination. */
|
|
59
|
-
function boardPublisher(source: string | null | undefined): string | undefined {
|
|
60
|
-
return source?.trim().replace(/\bPPD\b/, "Public Price Dissemination") || undefined;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
58
|
/**
|
|
64
59
|
* Each day's level on the contract on the run that day, newest first, over
|
|
65
60
|
* the last `days`: the chart as a table. Its key is `day`, not `date`, so the
|
|
@@ -224,12 +224,6 @@ export function formatSpreadRank(rank: SpreadRank): string {
|
|
|
224
224
|
return rank.basis === "price-inverted" && rank.percentile != null ? `${text}, price inverted` : text;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
/** The newest day a board's rows are dated, which its footer dates the board by; null with none. */
|
|
228
|
-
export function newestRowDate(dates: ReadonlyArray<string | null | undefined>): string | null {
|
|
229
|
-
return dates.reduce<string | null>((newest, date) => date && /^\d{4}-\d{2}-\d{2}/.test(date) && (!newest || date > newest)
|
|
230
|
-
? date.slice(0, 10) : newest, null);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
227
|
function daysBetween(from: string, to: string): number {
|
|
234
228
|
return Math.round((Date.parse(to) - Date.parse(from)) / 86_400_000);
|
|
235
229
|
}
|