@gloom-sh/terminal 0.20.11 → 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/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 +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/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/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/command-bar/action-runtime.ts +2 -0
- 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/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/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/market-board/index.tsx +14 -5
- package/src/components/metric-treemap/index.tsx +3 -1
- package/src/components/ui/button.tsx +48 -4
- 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/query-bar.tsx +16 -1
- package/src/components/ui/selection-fill.ts +39 -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/layout/pane-manager/dock-tree.ts +19 -0
- package/src/layout/pane-manager/index.ts +3 -0
- 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/live-valuation.ts +31 -4
- 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/index.tsx +1 -0
- 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 +3 -4
- package/src/plugins/builtin/cloud/askg/pane.tsx +4 -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/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/fx-matrix/index.tsx +30 -19
- package/src/plugins/builtin/insider/table.tsx +10 -7
- package/src/plugins/builtin/insider/tickers.tsx +1 -1
- package/src/plugins/builtin/iv-history/headless.ts +9 -8
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/macro-day/headless.ts +3 -3
- 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 +1 -0
- package/src/plugins/builtin/options-positioning/pane.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -31
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +6 -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 +10 -1
- package/src/plugins/builtin/realized-vol/headless.ts +28 -2
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- 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/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 +4 -2
- package/src/plugins/builtin/vol-surface/pane.tsx +5 -2
- 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/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/view/cli-pane-shot-entry.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/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 +24 -1
- package/src/state/pane-unsent-work.ts +47 -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/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/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 +6 -0
- package/src/utils/double-escape-close.ts +42 -0
- package/src/utils/fx-status.ts +30 -7
- package/src/utils/network-failure.ts +23 -0
|
@@ -15,6 +15,8 @@ import { formatPercentileRank } from "../../../utils/format";
|
|
|
15
15
|
import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
16
16
|
import { useResearchCloudSession } from "../shared/research-cloud-session";
|
|
17
17
|
import { getCachedHongKongMoneyMarkets, getCachedMoneyMarkets, loadHongKongMoneyMarkets, loadMoneyMarkets } from "./client";
|
|
18
|
+
import { moneyMarketReport, moneyMarketsHeadless } from "./headless";
|
|
19
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
18
20
|
import { isHongKongTab, MONEY_MARKET_TABS, moneyMarketAxis, moneyMarketChange, moneyMarketCurves, moneyMarketNotices, moneyMarketObservations, moneyMarketRateChange, moneyMarketRowNotices, moneyMarketRows, moneyMarketValue } from "./model";
|
|
19
21
|
|
|
20
22
|
const TABS = MONEY_MARKET_TABS.map(({ value, label }) => ({ value, label }));
|
|
@@ -128,6 +130,12 @@ export function MoneyMarketsPane({ width, height, focused }: PaneProps) {
|
|
|
128
130
|
} : null;
|
|
129
131
|
const figures = billsTab ? billsItems : [];
|
|
130
132
|
const updatedAgo = useUpdatedAgo(active.updatedAt);
|
|
133
|
+
const sourceLine = useMemo(() => {
|
|
134
|
+
if (!shown) return null;
|
|
135
|
+
const report = moneyMarketReport(hongKong ? hongKongData?.rows ?? [] : data ? moneyMarketRows(data, tab) : [], hongKong);
|
|
136
|
+
return reportFooterSegment(moneyMarketsHeadless, { ...report.freshness ? { freshness: report.freshness } : {},
|
|
137
|
+
sections: [{ title: "", columns: [], rows: report.rows }] });
|
|
138
|
+
}, [data, hongKong, hongKongData, shown, tab]);
|
|
131
139
|
const { strip: tabStrip, rows: tabRows } = usePaneTabs({ tabs: TABS, activeValue: tab, onSelect: setTab, focused, dense: true });
|
|
132
140
|
const bodyHeight = Math.max(3, height - tabRows);
|
|
133
141
|
useAutoRefresh(active.updatedAt, active.load);
|
|
@@ -137,7 +145,8 @@ export function MoneyMarketsPane({ width, height, focused }: PaneProps) {
|
|
|
137
145
|
...(active.data?.refreshError ? [active.data.refreshError] : [])] });
|
|
138
146
|
usePaneStatusLinkFooter({ registrationId: "money-markets", focused, loading: active.loading, error: active.error,
|
|
139
147
|
url: selected?.observation.sourceUrl ?? null, showOpenHint: true,
|
|
140
|
-
|
|
148
|
+
// Its source and the rows' dates, as `fn BTMM` ends; how long ago it loaded goes first on a narrow row.
|
|
149
|
+
info: shown ? [sourceLine!, ...(updatedAgo ? [ageFooterSegment(updatedAgo)] : [])] : [],
|
|
141
150
|
stale: !!shown && active.data?.stale,
|
|
142
151
|
});
|
|
143
152
|
return <Box width={width} height={height} flexDirection="column">
|
|
@@ -359,6 +359,7 @@ export function OptionsView({ width, height, focused, nestedInTabs = false, ivRa
|
|
|
359
359
|
id: "expiration",
|
|
360
360
|
label: "Exp",
|
|
361
361
|
inline: true,
|
|
362
|
+
scrolls: true,
|
|
362
363
|
value: String(selectedExpiration),
|
|
363
364
|
// The dates either side name the key that steps to them: a terminal
|
|
364
365
|
// label prefix, a desktop tooltip.
|
|
@@ -334,7 +334,7 @@ function OptionsPositioningView({ width, height, focused, symbol }: PaneProps &
|
|
|
334
334
|
usePaneNoticeFooter({ registrationId: "options-positioning:notices", focused, notices });
|
|
335
335
|
|
|
336
336
|
const expiryFilter = (value: string, options: { value: string; label: string }[], onChange: (value: string) => void): QueryBarFilter => ({
|
|
337
|
-
id: "expiry", label: "Exp", inline: true, value, onChange,
|
|
337
|
+
id: "expiry", label: "Exp", inline: true, scrolls: true, value, onChange,
|
|
338
338
|
options: options.map((option, index) => ({
|
|
339
339
|
...option,
|
|
340
340
|
hint: index === options.findIndex((entry) => entry.value === value) - 1 ? EXPIRY_PREVIOUS_KEY
|
|
@@ -8,6 +8,7 @@ import { splitSymbolArgs, splitSymbolWords, symbolInputKey } from "../../../../c
|
|
|
8
8
|
import { notASymbolError } from "../../../../cli/symbol-cells";
|
|
9
9
|
import { readSymbolList, SymbolListError } from "../../../../cli/symbol-list";
|
|
10
10
|
import { cliStyles } from "../../../../utils/cli-output";
|
|
11
|
+
import { listProgressNotice } from "../../../../cli/list-progress";
|
|
11
12
|
import { shellWord } from "../../../../utils/shell-word";
|
|
12
13
|
import { logFailure } from "../../../../utils/log-failure";
|
|
13
14
|
import { parsePublicTickerKey } from "../../../../utils/exchanges";
|
|
@@ -256,45 +257,17 @@ export function retryNotice(ctx: CliCommandContext): (count: number, waitMs: num
|
|
|
256
257
|
};
|
|
257
258
|
}
|
|
258
259
|
|
|
259
|
-
/** A lookup this slow says how far it has got, so an add never looks stuck: first after two seconds, then every five. */
|
|
260
|
-
const PROGRESS_AFTER_MS = 2_000;
|
|
261
|
-
const PROGRESS_EVERY_MS = 5_000;
|
|
262
|
-
|
|
263
260
|
/**
|
|
264
261
|
* Lines on standard error while an add of several symbols is slow to look
|
|
265
262
|
* them up: "Looking up 10 symbols." two seconds in when none is settled yet,
|
|
266
263
|
* else "Looked up 4 of 10 symbols.", which it says again every five seconds
|
|
267
|
-
* until all are
|
|
268
|
-
* (0, total) as the lookup starts and each symbol as it settles; the lines
|
|
269
|
-
* come from a timer, so a lookup waiting on one slow answer still says so.
|
|
264
|
+
* until all are (`listProgressNotice`).
|
|
270
265
|
*/
|
|
271
266
|
export function progressNotice(
|
|
272
267
|
ctx: Pick<CliCommandContext, "cliOptions">,
|
|
273
|
-
|
|
268
|
+
timing: { afterMs?: number; everyMs?: number } = {},
|
|
274
269
|
): (looked: number, total: number) => void {
|
|
275
|
-
|
|
276
|
-
let looked = 0, total = 0, told = false;
|
|
277
|
-
const tell = () => {
|
|
278
|
-
timer = undefined;
|
|
279
|
-
if (looked >= total) return;
|
|
280
|
-
console.error(cliStyles.muted(told || looked > 0 ? `Looked up ${looked} of ${total} symbols.` : `Looking up ${total} symbols.`));
|
|
281
|
-
told = true;
|
|
282
|
-
schedule(everyMs);
|
|
283
|
-
};
|
|
284
|
-
const schedule = (ms: number) => {
|
|
285
|
-
timer = setTimeout(tell, ms);
|
|
286
|
-
// The add's own end, not this line, decides when the process exits.
|
|
287
|
-
(timer as { unref?: () => void }).unref?.();
|
|
288
|
-
};
|
|
289
|
-
return (settled, of) => {
|
|
290
|
-
if (ctx.cliOptions.quiet || of < 2) return;
|
|
291
|
-
looked = settled;
|
|
292
|
-
total = of;
|
|
293
|
-
if (looked >= total) {
|
|
294
|
-
if (timer) clearTimeout(timer);
|
|
295
|
-
timer = undefined;
|
|
296
|
-
} else if (!timer) schedule(afterMs);
|
|
297
|
-
};
|
|
270
|
+
return listProgressNotice(ctx, (looked, total, told) => told || looked > 0 ? `Looked up ${looked} of ${total} symbols.` : `Looking up ${total} symbols.`, timing);
|
|
298
271
|
}
|
|
299
272
|
|
|
300
273
|
/**
|
|
@@ -104,6 +104,7 @@ import { openPerpLabel, useOpenPerpMarket } from "../../perps/open-market";
|
|
|
104
104
|
import { useLiveStreamingSetting } from "../../../../state/hooks/live-streaming";
|
|
105
105
|
import { useThrottledTickerOrder } from "../use-throttled-ticker-order";
|
|
106
106
|
import { useThrottledMemo } from "../use-throttled-memo";
|
|
107
|
+
import { useUtcDay } from "../../../../react/auto-refresh";
|
|
107
108
|
import { perpetualDisplaySymbol, perpetualListing, perpetualVenueName } from "../../../../tickers/perpetual-listing";
|
|
108
109
|
import { useColumnClock } from "../use-column-clock";
|
|
109
110
|
import { liveMarketCapitalization } from "../../../../market-data/quotes/live-valuation";
|
|
@@ -672,6 +673,8 @@ export function PortfolioListPane({ focused, width, height }: PaneProps) {
|
|
|
672
673
|
liveStreaming,
|
|
673
674
|
});
|
|
674
675
|
|
|
676
|
+
// The quotes' time of today drops its day; the next day the footer names it.
|
|
677
|
+
const utcDay = useUtcDay();
|
|
675
678
|
const summaryFooterInfo = useThrottledMemo(() => buildPortfolioFooterSegments({
|
|
676
679
|
accountState: summaryAccountState,
|
|
677
680
|
accountStatusText: accountsError
|
|
@@ -692,6 +695,7 @@ export function PortfolioListPane({ focused, width, height }: PaneProps) {
|
|
|
692
695
|
portfolioSummaryTotals,
|
|
693
696
|
refreshingSize,
|
|
694
697
|
summaryAccountState,
|
|
698
|
+
utcDay,
|
|
695
699
|
], FOOTER_TOTALS_THROTTLE_MS);
|
|
696
700
|
const fxWarning = !!(fxStatus.stale || fxStatus.unknownTime || fxStatus.unavailable);
|
|
697
701
|
// Signed out or free, the rows' prices are the delayed ones; a list of coins is live and says nothing.
|
|
@@ -795,9 +799,10 @@ export function PortfolioListPane({ focused, width, height }: PaneProps) {
|
|
|
795
799
|
...offlineBrokerFooter.asOf,
|
|
796
800
|
...summaryFooterInfo,
|
|
797
801
|
...offlineBrokerFooter.status,
|
|
802
|
+
// The delay clock beside the quotes' source and time; the FX note after it gives way first on a narrow row.
|
|
803
|
+
...(quoteDelay ? [quoteDelay] : []),
|
|
798
804
|
...(fxStatusText && !fxWarning ? [{ id: "fx", parts: [{ text: `FX ${fxStatusText}`, tone: "muted" as const }] }] : []),
|
|
799
805
|
...(showsPerpetuals && perpetuals.stale ? [{ id: "perpetuals", parts: [{ text: "perpetuals stale", tone: "warning" as const }] }] : []),
|
|
800
|
-
...(quoteDelay ? [quoteDelay] : []),
|
|
801
806
|
],
|
|
802
807
|
hints: [
|
|
803
808
|
...offlineBrokerFooter.hints,
|
|
@@ -214,9 +214,20 @@ export function QuickAddTickerInput({
|
|
|
214
214
|
keepFailureRef.current = false;
|
|
215
215
|
listMemoRef.current = createQuickAddListMemo();
|
|
216
216
|
setInputValue("");
|
|
217
|
+
// The field keeps its own text, cursor and scroll until told: an add that left them read the next symbol
|
|
218
|
+
// scrolled by one ("+ SDTRY=X" for USDTRY=X).
|
|
219
|
+
inputRef.current?.editBuffer?.setText?.("");
|
|
220
|
+
inputRef.current?.setCursorOffset?.(0);
|
|
217
221
|
setValidation(IDLE_VALIDATION);
|
|
218
222
|
}, []);
|
|
219
223
|
|
|
224
|
+
/** An add is done: the row closes, empty, and `a` opens it again. */
|
|
225
|
+
const closeAfterAdd = useCallback(() => {
|
|
226
|
+
resetInput();
|
|
227
|
+
inputRef.current?.blur?.();
|
|
228
|
+
setInputFocused(false);
|
|
229
|
+
}, [resetInput]);
|
|
230
|
+
|
|
220
231
|
const clearFailedInput = useCallback((failure: QuickAddValidation) => {
|
|
221
232
|
keepFailureRef.current = true;
|
|
222
233
|
validationSeqRef.current += 1;
|
|
@@ -393,10 +404,13 @@ export function QuickAddTickerInput({
|
|
|
393
404
|
...skipped,
|
|
394
405
|
].join(" "),
|
|
395
406
|
});
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
407
|
+
// Something added, or nothing left to fix: done. Entries left out keep the row open on what to fix.
|
|
408
|
+
if (added.length > 0 || left.length === 0) closeAfterAdd();
|
|
409
|
+
else {
|
|
410
|
+
setValidation(list);
|
|
411
|
+
queueMicrotask(() => inputRef.current?.focus?.());
|
|
412
|
+
}
|
|
413
|
+
}, [addReady, closeAfterAdd, collectionKind, collectionName, notify, onAdded]);
|
|
400
414
|
|
|
401
415
|
const submitInput = useCallback(async (submittedValue?: string) => {
|
|
402
416
|
// Before any lookup: consent to count the add cannot be given after it.
|
|
@@ -435,7 +449,7 @@ export function QuickAddTickerInput({
|
|
|
435
449
|
collection: collectionName,
|
|
436
450
|
}),
|
|
437
451
|
});
|
|
438
|
-
|
|
452
|
+
closeAfterAdd();
|
|
439
453
|
return;
|
|
440
454
|
}
|
|
441
455
|
if (currentValidation.status !== "ready") {
|
|
@@ -463,6 +477,7 @@ export function QuickAddTickerInput({
|
|
|
463
477
|
collection: collectionName,
|
|
464
478
|
}),
|
|
465
479
|
});
|
|
480
|
+
closeAfterAdd();
|
|
466
481
|
return;
|
|
467
482
|
}
|
|
468
483
|
|
|
@@ -472,8 +487,7 @@ export function QuickAddTickerInput({
|
|
|
472
487
|
collection: collectionName,
|
|
473
488
|
});
|
|
474
489
|
notify({ type: "success", body: added.note ? `${body} ${added.note}.` : body });
|
|
475
|
-
|
|
476
|
-
queueMicrotask(() => inputRef.current?.focus?.());
|
|
490
|
+
closeAfterAdd();
|
|
477
491
|
} catch {
|
|
478
492
|
setValidation({ status: "error", query, message: "Ticker add failed" });
|
|
479
493
|
notify({ type: "error", body: tf("Failed to add {symbol}.", { symbol: query }) });
|
|
@@ -483,12 +497,12 @@ export function QuickAddTickerInput({
|
|
|
483
497
|
}, [
|
|
484
498
|
addReady,
|
|
485
499
|
clearFailedInput,
|
|
500
|
+
closeAfterAdd,
|
|
486
501
|
collectionName,
|
|
487
502
|
handOffListingChoice,
|
|
488
503
|
inputValue,
|
|
489
504
|
notify,
|
|
490
505
|
onAdded,
|
|
491
|
-
resetInput,
|
|
492
506
|
submitList,
|
|
493
507
|
submitting,
|
|
494
508
|
validateInput,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "../account-metrics";
|
|
21
21
|
import { formatPortfolioAmount, type PortfolioSummaryTotals } from "./totals";
|
|
22
22
|
import { formatAllocationDrift, formatAllocationWeight, type PortfolioCashLine } from "../../../../portfolio/allocation";
|
|
23
|
-
import {
|
|
23
|
+
import { quoteSourceFooterSegment } from "../../shared/source-footer";
|
|
24
24
|
import { fxStatusLabel, type FxRateStatus } from "../../../../utils/fx-status";
|
|
25
25
|
import { t } from "../../../../i18n";
|
|
26
26
|
import type { PortfolioValuationBasis } from "../../../../portfolio/valuation-basis";
|
|
@@ -490,13 +490,11 @@ export function buildPortfolioFooterSegments({
|
|
|
490
490
|
if (savedAt != null) return [...accountStatus, savedCopyFooterSegment("refresh", savedAt)];
|
|
491
491
|
if (isPortfolioTab ? !totals.hasPositions && !accountStatusText : totals.watchlistCount === 0) return [];
|
|
492
492
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
: "-";
|
|
499
|
-
return [...accountStatus, { id: "refresh", parts: [{ text: refreshText, tone: "muted" }] }];
|
|
493
|
+
// Where the quotes are from and the newest's time, as `quote` ends (`Gloom Cloud · 14:44 UTC · markets open`):
|
|
494
|
+
// a bare local time ("Thu 12:25") named neither.
|
|
495
|
+
const quoted = refreshingSize > 0 ? null : quoteSourceFooterSegment(quotes, { id: "refresh" });
|
|
496
|
+
const refresh: PaneFooterSegment = quoted ?? { id: "refresh", parts: [{ text: refreshingSize > 0 ? "Refreshing..." : "-", tone: "muted" }] };
|
|
497
|
+
return [...accountStatus, refresh];
|
|
500
498
|
}
|
|
501
499
|
|
|
502
500
|
const MAX_NOTICE_SYMBOLS = 12;
|
|
@@ -17,6 +17,7 @@ import type { TickerRecord } from "../../../types/ticker";
|
|
|
17
17
|
import { objectVersion } from "../../../utils/object-version";
|
|
18
18
|
import { columnContextVersion, PERPETUAL_COLUMN_IDS } from "./cell-version";
|
|
19
19
|
import { getColumnValue, type ColumnContext } from "./metrics";
|
|
20
|
+
import { RANGE_FROM_BARS_NOTE } from "../../../portfolio/column-values";
|
|
20
21
|
import { periodPnlFigure, tickerDisplayName } from "../../../portfolio/column-values";
|
|
21
22
|
import { listedSymbol } from "../../../portfolio/listed-symbol";
|
|
22
23
|
import { displayWidth } from "../../../utils/format";
|
|
@@ -297,6 +298,12 @@ export function PortfolioTickerTable({
|
|
|
297
298
|
priceColumn.width,
|
|
298
299
|
))
|
|
299
300
|
: 0, [columnContext.valuationBasis, priceColumn, resolveCell, sortedTickers, tableFinancialsMap]);
|
|
301
|
+
// 52W% grows to show a range read from daily bars as one ("+45.30% bars"), as LAST grows for its session mark.
|
|
302
|
+
const rangeColumn = columns.find((column) => column.id === "range_52w");
|
|
303
|
+
const rangeWidth = useMemo(() => rangeColumn && sortedTickers.some((ticker) =>
|
|
304
|
+
tableFinancialsMap.get(ticker.metadata.ticker)?.quote?.yearRangeBasis === "daily-bars")
|
|
305
|
+
? rangeColumn.width + displayWidth(RANGE_FROM_BARS_NOTE) + 1
|
|
306
|
+
: 0, [rangeColumn, sortedTickers, tableFinancialsMap]);
|
|
300
307
|
// The Ticker column grows to its longest symbol, so ETH-USD and BA:LSE show whole beside their market-state dot.
|
|
301
308
|
const tickerWidth = useMemo(() => Math.min(MAX_TICKER_COLUMN_WIDTH, sortedTickers.reduce(
|
|
302
309
|
(widest, ticker) => Math.max(widest, TICKER_DOT_WIDTH + displayWidth(listedSymbol(ticker, tickerDisplayName(ticker), columnContext.homeMarket))),
|
|
@@ -311,13 +318,15 @@ export function PortfolioTickerTable({
|
|
|
311
318
|
: column.id === "weight" && grossWeights ? { ...column, label: GROSS_WEIGHT_LABEL }
|
|
312
319
|
: column.id === "ticker" && tickerWidth > column.width ? { ...column, width: tickerWidth }
|
|
313
320
|
: column.id === "price" && priceWidth > column.width ? { ...column, width: priceWidth }
|
|
321
|
+
: column.id === "range_52w" && rangeWidth > column.width ? { ...column, width: rangeWidth }
|
|
314
322
|
: column.id === "pnl_pct" && period ? { ...column, label: CONTRIBUTION_LABEL }
|
|
315
323
|
: pnlLabel !== "P&L" && (column.id === "pnl" || column.id === "pnl_pct") ? {
|
|
316
324
|
...column,
|
|
317
325
|
label: column.id === "pnl_pct" ? pnlLabel.replace("P&L", "%") : pnlLabel,
|
|
318
326
|
} : column).map((column) => BOOK_CURRENCY_COLUMN_IDS.has(column.id) ? bookCurrencyColumn(column, capCurrency) : column)
|
|
319
327
|
.map((column) => hasFrontReference && column.id === noteColumnId ? { ...column, flexGrow: 1 } : column),
|
|
320
|
-
[capCurrency, columns, grossWeights, hasFrontReference, hasNonShareQuantity, noteColumnId, period, pnlLabel, priceWidth, sharesWidth,
|
|
328
|
+
[capCurrency, columns, grossWeights, hasFrontReference, hasNonShareQuantity, noteColumnId, period, pnlLabel, priceWidth, rangeWidth, sharesWidth,
|
|
329
|
+
tickerWidth]);
|
|
321
330
|
// Read again as the rows' data moves, from the cells the rows show; the columns change only when what is hidden does.
|
|
322
331
|
// The company columns hidden last time, per list, stay hidden while a row added since settles.
|
|
323
332
|
const hiddenCompanyRef = useRef<{ list: string | undefined; ids: ReadonlySet<string> }>({ list: undefined, ids: new Set() });
|
|
@@ -3,7 +3,7 @@ import type { HeadlessPaneDefinition } from "../../../types/plugin";
|
|
|
3
3
|
import { createSurfaceDependencies } from "../vol-surface/client";
|
|
4
4
|
import { resolveHeadlessInstrument } from "../shared/headless-market-data";
|
|
5
5
|
import { createRealizedVolatilityDependencies, loadCurrentAtmIv, loadRealizedVolatilityHistory } from "./client";
|
|
6
|
-
import { atmIvObservedLabel, projectRealizedVolatility, type CurrentAtmIvSnapshot } from "./model";
|
|
6
|
+
import { atmIvObservedLabel, projectRealizedVolatility, type CurrentAtmIvSnapshot, type RealizedVolatilityModel } from "./model";
|
|
7
7
|
import { ESTIMATOR_OPTIONS, selectedWindows } from "./settings";
|
|
8
8
|
import { DAILY_CLOSES } from "../shared/report-freshness";
|
|
9
9
|
import { listingAbroadVenue } from "../../../utils/sec";
|
|
@@ -30,10 +30,35 @@ function fxProxySection(proxy: FxVolProxy, reading: FxProxyReading): HeadlessBun
|
|
|
30
30
|
formatted: proxy.iv30 ? `${proxy.iv30.date}${proxy.iv30.method === "quote-mid" ? " (quote mid)" : ""}${stale ? ", stale" : ""}` : "--" },
|
|
31
31
|
{ label: fxProxyChainLabel(proxy), value: proxy.expiries?.usable ?? null, formatted: fxProxyChainText(proxy, Date.now()) },
|
|
32
32
|
{ label: "Pair HV20", value: hv20, formatted: percent(hv20) },
|
|
33
|
-
|
|
33
|
+
// In points of volatility, which the label names, so an export writes the bare number.
|
|
34
|
+
{ label: "IV30 - HV20 (pts)", value: spread, formatted: spread == null ? "--" : `${spread >= 0 ? "+" : ""}${(spread * 100).toFixed(2)}` },
|
|
34
35
|
] };
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
/** Sessions of the history the text report prints; exports write every session of the lookback. */
|
|
39
|
+
const HISTORY_TEXT_SESSIONS = 10;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Each session's estimate for the windows shown, newest first, as HIVG's daily
|
|
43
|
+
* history is: the series the graph draws, which exports write as numbers in
|
|
44
|
+
* percent under one column per window (HV20 (%)). The text report prints the
|
|
45
|
+
* latest sessions.
|
|
46
|
+
*/
|
|
47
|
+
function historySection(model: RealizedVolatilityModel): HeadlessBundleSection {
|
|
48
|
+
const rows = model.series.map((point) => ({
|
|
49
|
+
date: point.date.toISOString().slice(0, 10),
|
|
50
|
+
...Object.fromEntries(model.windows.map((window) => [`hv${window}`, point.values[window] ?? null])),
|
|
51
|
+
})).reverse();
|
|
52
|
+
return {
|
|
53
|
+
title: "History",
|
|
54
|
+
textTitle: `History, latest ${Math.min(HISTORY_TEXT_SESSIONS, rows.length)} sessions`,
|
|
55
|
+
columns: [{ key: "date", header: "Date" }, ...model.windows.map((window) => ({ key: `hv${window}`, header: `HV${window}`,
|
|
56
|
+
format: (value: unknown) => typeof value === "number" ? `${(value * 100).toFixed(2)}%` : "--" }))],
|
|
57
|
+
rows,
|
|
58
|
+
textRows: rows.slice(0, HISTORY_TEXT_SESSIONS),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
37
62
|
export function realizedVolHeadless(initialView: "graph" | "cone"): HeadlessPaneDefinition<"bundle"> {
|
|
38
63
|
return {
|
|
39
64
|
shape: "bundle", argument: { kind: "ticker", description: "Underlying ticker" }, currencyPairs: true,
|
|
@@ -102,6 +127,7 @@ export function realizedVolHeadless(initialView: "graph" | "cone"): HeadlessPane
|
|
|
102
127
|
{ key: "percentile", header: "Percentile", format: (value) => typeof value === "number" ? `${value.toFixed(1)}%` : "--" },
|
|
103
128
|
{ key: "sampleSize", header: "Samples" },
|
|
104
129
|
], rows: model.cone.map((row) => ({ ...row })) },
|
|
130
|
+
...model.series.length > 0 ? [historySection(model)] : [],
|
|
105
131
|
...proxy && proxyReading ? [fxProxySection(proxy, proxyReading)] : fx || !args.options.showIv ? [] : [{ title: "Current IV", entries: [
|
|
106
132
|
{ label: "ATM IV", value: iv?.reference?.value ?? null, formatted: iv?.reference ? `${(iv.reference.value * 100).toFixed(2)}%` : "--" },
|
|
107
133
|
{ label: "Expiry", value: iv?.reference?.expiration ?? null,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { PaneFooterSegment } from "../../../components/layout/pane/footer";
|
|
2
|
+
import { deriveHeadlessFreshness, paneSourceLineVariants, type ReportFreshness } from "../../../cli/pane-functions/freshness";
|
|
3
|
+
import { quotesFreshness } from "../../../cli/freshness";
|
|
4
|
+
import { quoteSourceName } from "../../../market-data/quotes/export-identity";
|
|
5
|
+
import { quoteHeadlineTime } from "../../../market-data/market/status";
|
|
6
|
+
import type { Quote } from "../../../types/financials";
|
|
7
|
+
import type { HeadlessPaneDefinition, HeadlessPaneResult } from "../../../types/headless";
|
|
8
|
+
import { getSharedRegistry } from "../../registry";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The footer's one form for where a pane's data comes from and how current it
|
|
12
|
+
* is, the line its `fn` report ends with (paneSourceLineVariants): `DTCC · Thu
|
|
13
|
+
* 12 Nov 2026 · not a live feed (daily levels of public trades)`. A narrow row
|
|
14
|
+
* shortens it to the source and the date, then the date alone. `feed: false`
|
|
15
|
+
* leaves out the delay a pane's clock already shows.
|
|
16
|
+
*/
|
|
17
|
+
function sourceFooterSegment(
|
|
18
|
+
freshness: ReportFreshness,
|
|
19
|
+
{ id = "source", feed = true, time }: {
|
|
20
|
+
id?: string;
|
|
21
|
+
feed?: boolean;
|
|
22
|
+
/** The data's time in its fewest cells (`12:25 UTC`), for a row too narrow for the line's own date: after the sourced lines and last. */
|
|
23
|
+
time?: string;
|
|
24
|
+
} = {},
|
|
25
|
+
): PaneFooterSegment {
|
|
26
|
+
const lines = paneSourceLineVariants(freshness, { feed });
|
|
27
|
+
const sourced = freshness.source ? lines.filter((line) => line.startsWith(`${freshness.source} · `)) : [];
|
|
28
|
+
const ordered = time
|
|
29
|
+
? [...sourced, ...freshness.source ? [`${freshness.source} · ${time}`] : [], ...lines.filter((line) => !sourced.includes(line)), time]
|
|
30
|
+
: lines;
|
|
31
|
+
const [line, ...shorter] = [...new Set(ordered)].map((text) => [{ text, tone: "muted" as const }]);
|
|
32
|
+
return { id, asOf: true, parts: line!, ...(shorter.length ? { variants: shorter } : {}) };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** `12:25 UTC` on the day it is read, `Thu 12 Nov 12:25 UTC` before. */
|
|
36
|
+
function compactTime(time: number, now: number): string {
|
|
37
|
+
const at = new Date(time);
|
|
38
|
+
const clock = `${at.toISOString().slice(11, 16)} UTC`;
|
|
39
|
+
if (at.toISOString().slice(0, 10) === new Date(now).toISOString().slice(0, 10)) return clock;
|
|
40
|
+
return `${at.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short", timeZone: "UTC" }).replace(",", "")} ${clock}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** {@link sourceFooterSegment} for a pane's data read as its report reads it: the definition's freshness over `result`. */
|
|
44
|
+
export function reportFooterSegment(
|
|
45
|
+
definition: Pick<HeadlessPaneDefinition, "shape" | "freshness">,
|
|
46
|
+
result: HeadlessPaneResult,
|
|
47
|
+
options: { id?: string; feed?: boolean; now?: number } = {},
|
|
48
|
+
): PaneFooterSegment {
|
|
49
|
+
return sourceFooterSegment(deriveHeadlessFreshness(definition, result, options.now), options);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* {@link sourceFooterSegment} for the quotes a pane shows, as `quote` ends: where they are from (Gloom Cloud, a
|
|
54
|
+
* broker by its name) and the newest's session or time, `Gloom Cloud · EGX trading day Thu 12 Nov 2026 close`,
|
|
55
|
+
* down to `Gloom Cloud · 12:25 UTC` and the time alone in a narrow pane. Its delay is left to the pane's clock.
|
|
56
|
+
* A quote whose source has no name to give leaves the source out rather than calling it Gloom Cloud. Null with
|
|
57
|
+
* no quote.
|
|
58
|
+
*/
|
|
59
|
+
export function quoteSourceFooterSegment(
|
|
60
|
+
quotes: Iterable<Quote | null | undefined>,
|
|
61
|
+
{ id = "source", now = Date.now() }: { id?: string; now?: number } = {},
|
|
62
|
+
): PaneFooterSegment | null {
|
|
63
|
+
const shown = [...quotes].filter((quote): quote is Quote => quote != null && quote.lastUpdated > 0);
|
|
64
|
+
const names = [...new Set(shown.map((quote) => quoteSourceName(quote, (providerId) => getSharedRegistry()?.getBrokerAdapter(providerId)?.name)))];
|
|
65
|
+
const source = names.length > 0 && names.every(Boolean) ? names.join(" and ") : "";
|
|
66
|
+
const freshness = quotesFreshness(shown, undefined, now);
|
|
67
|
+
if (!freshness) return null;
|
|
68
|
+
const newest = Math.max(...shown.map((quote) => quoteHeadlineTime(quote)));
|
|
69
|
+
return sourceFooterSegment({ ...freshness, source }, { id, feed: false, ...Number.isFinite(newest) && newest > 0 ? { time: compactTime(newest, now) } : {} });
|
|
70
|
+
}
|
|
@@ -10,6 +10,8 @@ import type { PaneProps } from "../../../types/plugin";
|
|
|
10
10
|
import { isKnownNonUsEquityTicker } from "../../../utils/sec";
|
|
11
11
|
import { listingIdentity } from "../shared/ticker-request";
|
|
12
12
|
import { cachedPublication, loadPublication, type PublicationKind } from "./publications-client";
|
|
13
|
+
import { publicationHeadless } from "./publications-headless";
|
|
14
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
13
15
|
import { publicationCell, publicationColumns, publicationRows, sharedFailIdentity, type PublicationColumn, type PublicationRow } from "./publications-model";
|
|
14
16
|
|
|
15
17
|
function renderCell(row: PublicationRow, column: PublicationColumn, _index: number, state: { selected: boolean }): DataTableCell {
|
|
@@ -48,7 +50,9 @@ export function ShortSidePublicationPane({ kind, width, height, focused }: Pick<
|
|
|
48
50
|
notices: [...(data?.warnings ?? []), ...(resource.data?.refreshError ? [resource.data.refreshError] : [])] });
|
|
49
51
|
usePaneStatusLinkFooter({ registrationId: kind, focused, loading: resource.loading, error: resource.error,
|
|
50
52
|
url: selected?.sourceUrl ?? data?.source.url ?? null, showOpenHint: true,
|
|
51
|
-
|
|
53
|
+
// Its source and newest date, as `fn FTD` and `fn ATS` end; how long ago it loaded goes first on a narrow row.
|
|
54
|
+
info: data ? [reportFooterSegment(publicationHeadless(kind), { sections: [{ title: "", columns: [], rows: publicationRows(data) }] }),
|
|
55
|
+
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : [])] : [],
|
|
52
56
|
stale: !!data && resource.data?.stale,
|
|
53
57
|
});
|
|
54
58
|
if (!symbol) return <EmptyState title="No ticker selected." message={`Select a US stock to view ${subject}.`} />;
|
|
@@ -14,6 +14,8 @@ import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
|
14
14
|
import { SignInWall } from "../cloud/auth-actions";
|
|
15
15
|
import { isCloudSessionRequired, useResearchCloudSession } from "../shared/research-cloud-session";
|
|
16
16
|
import { cachedShortVolume, loadShortVolume } from "./client";
|
|
17
|
+
import { shortVolumeHeadless } from "./headless";
|
|
18
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
17
19
|
import { exactQuantity, sortedVolumeHistory, VOLUME_COLUMNS, volumeChange, volumeHistoryPoints, volumePercent, volumePointStatus, volumeQuantity, type VolumeColumn, type VolumeSort } from "./model";
|
|
18
20
|
import { usePaneTickerIdentity } from "../../../state/hooks/pane-ticker";
|
|
19
21
|
|
|
@@ -84,7 +86,9 @@ export function ShortVolumePane({ width, height, focused }: Pick<PaneProps, "wid
|
|
|
84
86
|
notices: [...(data?.warnings ?? []), ...(resource.data?.refreshError ? [resource.data.refreshError] : [])] });
|
|
85
87
|
usePaneStatusLinkFooter({ registrationId: "short-volume", focused, loading: resource.loading, error: resource.error,
|
|
86
88
|
url: selected?.sourceUrl ?? data?.source.url ?? null, showOpenHint: true,
|
|
87
|
-
|
|
89
|
+
// Its source and newest day, as `fn SIV` ends; how long ago it loaded goes first on a narrow row.
|
|
90
|
+
info: data ? [reportFooterSegment(shortVolumeHeadless, { sections: [{ title: "", columns: [], rows: data.history.map((point) => ({ date: point.date })) }] }),
|
|
91
|
+
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : [])] : [],
|
|
88
92
|
stale: !!data && resource.data?.stale,
|
|
89
93
|
});
|
|
90
94
|
if (!data && isCloudSessionRequired(resource.error)) return <SignInWall placement="short-volume-signin" action="view daily short volume" needsVerification={session.needsVerification} />;
|
|
@@ -11,6 +11,9 @@ import {
|
|
|
11
11
|
} from "../../../components";
|
|
12
12
|
import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
13
13
|
import { ageFooterSegment } from "../../../components/layout/pane/footer";
|
|
14
|
+
import { useUtcDay } from "../../../react/auto-refresh";
|
|
15
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
16
|
+
import { socialMentionsHeadless } from "./headless";
|
|
14
17
|
import { useAsyncResource, useAutoRefresh, useMarketData, usePluginPaneState, useUpdatedAgo } from "../../../public/react";
|
|
15
18
|
import { useThemeColors } from "../../../theme/theme-context";
|
|
16
19
|
import { Box } from "../../../ui";
|
|
@@ -154,13 +157,19 @@ export function SocialOutliersView({ width, height, focused, renderTicker }: {
|
|
|
154
157
|
}, [setOpenName, setOpenSymbol]);
|
|
155
158
|
|
|
156
159
|
const updatedAgo = useUpdatedAgo(resource.updatedAt);
|
|
160
|
+
const utcDay = useUtcDay();
|
|
161
|
+
// Its source and when the posts were counted, as `fn BUZZ` ends; how long ago it loaded goes first on a narrow row.
|
|
162
|
+
const footerInfo = useMemo(() => data ? [
|
|
163
|
+
reportFooterSegment(socialMentionsHeadless, { sections: [], metadata: { asOf: data.asOf } }),
|
|
164
|
+
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
|
|
165
|
+
] : [], [data, updatedAgo, utcDay]);
|
|
157
166
|
usePaneStatusFooter({
|
|
158
167
|
registrationId: "social-mentions:outliers",
|
|
159
168
|
enabled: !detailOpen,
|
|
160
169
|
loading: resource.loading,
|
|
161
170
|
error: data ? resource.error : null,
|
|
162
171
|
stale: !!data && !!shown?.stale,
|
|
163
|
-
info:
|
|
172
|
+
info: footerInfo,
|
|
164
173
|
});
|
|
165
174
|
usePaneNoticeFooter({
|
|
166
175
|
registrationId: "social-mentions:outliers:notices",
|
|
@@ -4,6 +4,9 @@ import { Box, ScrollBox, Text, useUiCapabilities } from "../../../ui";
|
|
|
4
4
|
import { useAsyncResource, useAutoRefresh, usePaneSettingValue, usePluginPaneState, useShortcut, useUpdatedAgo } from "../../../public/react";
|
|
5
5
|
import { CompositeChart, DataTableStackView, EmptyState, PaneStatusBody, usePaneNoticeFooter, usePaneStatusLinkFooter, type DataTableCell, StatGrid } from "../../../components";
|
|
6
6
|
import { ageFooterSegment } from "../../../components/layout/pane/footer";
|
|
7
|
+
import { useUtcDay } from "../../../react/auto-refresh";
|
|
8
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
9
|
+
import { socialMentionsHeadless } from "./headless";
|
|
7
10
|
import { colors } from "../../../theme/colors";
|
|
8
11
|
import type { SocialMentionPost, SocialMentionsRange } from "../../../api-client/social-mentions";
|
|
9
12
|
import { staticSeries } from "../../../components/chart/static/series";
|
|
@@ -119,6 +122,8 @@ function SocialMentionsTickerView({ width, height, focused, listingKey, onDetail
|
|
|
119
122
|
return () => clearTimeout(timer);
|
|
120
123
|
}, [pending, resource.updatedAt, resource.reload]);
|
|
121
124
|
useAutoRefresh(resource.updatedAt, resource.load);
|
|
125
|
+
// The footer leaves the day off a time of today; the next day it names it.
|
|
126
|
+
useUtcDay();
|
|
122
127
|
const dayOpen = !!openRow;
|
|
123
128
|
useEffect(() => onDetailChange?.(dayOpen), [dayOpen, onDetailChange]);
|
|
124
129
|
useEffect(() => () => onDetailChange?.(false), [onDetailChange]);
|
|
@@ -129,7 +134,9 @@ function SocialMentionsTickerView({ width, height, focused, listingKey, onDetail
|
|
|
129
134
|
const signInWall = !data && isCloudSessionRequired(resource.error);
|
|
130
135
|
usePaneStatusLinkFooter({ registrationId: "social-mentions", focused, loading: resource.loading || pending, error: signInWall ? null : resource.error,
|
|
131
136
|
url: selected?.topPost?.url ?? (symbol ? `https://x.com/search?q=%24${symbol}` : null), showOpenHint: true,
|
|
137
|
+
// Its source and when the posts were counted, as `fn BUZZ` ends; how long ago it loaded goes first on a narrow row.
|
|
132
138
|
info: data ? [
|
|
139
|
+
reportFooterSegment(socialMentionsHeadless, { sections: [], metadata: { asOf: data.asOf } }),
|
|
133
140
|
...(updatedAgo ? [ageFooterSegment(updatedAgo)] : []),
|
|
134
141
|
...(resource.data?.stale ? [{ id: "stale", parts: [{ text: "stale", tone: "warning" as const }] }] : []),
|
|
135
142
|
] : [],
|
|
@@ -32,7 +32,8 @@ function evidence(value: SupplyEvidenceItem): boolean {
|
|
|
32
32
|
&& finite(value.confidence) && value.confidence >= 0 && value.confidence <= 1
|
|
33
33
|
&& ["active", "superseded", "rejected", "stale"].includes(value.status)
|
|
34
34
|
&& (value.verificationStatus === undefined || ["verified", "lead"].includes(value.verificationStatus))
|
|
35
|
-
&& nullableText(value.valueKind) && (value.value === null || finite(value.value)) && nullableText(value.valueUnit) && nullableText(value.currency)
|
|
35
|
+
&& nullableText(value.valueKind) && (value.value === null || finite(value.value)) && nullableText(value.valueUnit) && nullableText(value.currency)
|
|
36
|
+
&& (value.relatedParty === undefined || typeof value.relatedParty === "boolean");
|
|
36
37
|
}
|
|
37
38
|
export function validSupplyEntity(value: SupplyEntity): boolean {
|
|
38
39
|
return !!value && text(value.id) && text(value.name) && nullableText(value.ticker) && nullableText(value.exchange)
|
|
@@ -53,6 +54,7 @@ export function validSupplyRow(value: SupplyRow): boolean {
|
|
|
53
54
|
&& (value.nativeAmount == null || (value.nativeCurrency != null && value.nativeScale != null && Number.isFinite(value.nativeAmount * value.nativeScale)))
|
|
54
55
|
&& (value.jurisdiction == null || (text(value.jurisdiction) && /^[A-Z]{2}$/.test(value.jurisdiction)))
|
|
55
56
|
&& [undefined, null, "entity", "group", "anonymous", "aggregate"].includes(value.entityScope)
|
|
57
|
+
&& (value.relatedParty === undefined || typeof value.relatedParty === "boolean")
|
|
56
58
|
&& (value.pctOfRevenue === null || value.pctBasis !== null) && (value.usd === null || value.usdBasis !== null)
|
|
57
59
|
&& text(value.period) && validPeriodMonths(value.periodMonths) && nullableText(value.fiscalYear) && ["xbrl", "filing_text", "call", "news", "web", "import", "press_release"].includes(value.sourceKind)
|
|
58
60
|
&& nullableText(value.form) && (value.filedDate === null || date(value.filedDate)) && date(value.asOf)
|