@gloom-sh/terminal 0.20.4 → 0.20.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/bin/gloom +9 -0
- package/bin/without-bun.cjs +98 -0
- package/package.json +3 -1
- package/src/api-client/data.ts +138 -35
- package/src/api-client/types/econ.ts +12 -0
- package/src/api-client/yield-curves.ts +1 -1
- package/src/app/global-shortcuts.ts +4 -1
- package/src/app/keybindings/actions.ts +6 -0
- package/src/app/keybindings/config.ts +2 -1
- package/src/app/keybindings/index.ts +1 -0
- package/src/app/keybindings/labels.ts +6 -1
- package/src/app/keybindings/resolve.ts +23 -4
- package/src/app/keybindings/terminal-keys.ts +35 -0
- package/src/app/pane-runtime/index.tsx +2 -2
- package/src/app/pane-runtime/ticker-open-runtime.ts +68 -40
- package/src/architecture/ui-literals-allowlist.json +1 -1
- package/src/capabilities/chart-series.ts +27 -1
- package/src/cli/commands/keybindings.ts +5 -5
- package/src/cli/commands/market.ts +78 -21
- package/src/cli/commands/news-search.ts +59 -7
- package/src/cli/commands/overview.ts +16 -1
- package/src/cli/commands/remote.ts +16 -17
- package/src/cli/commands/system.ts +1 -1
- package/src/cli/fx-forward.ts +25 -7
- package/src/cli/glossary.ts +19 -5
- package/src/cli/history-rows.ts +5 -3
- package/src/cli/known-gaps.ts +27 -1
- package/src/cli/listing-arg.ts +11 -1
- package/src/cli/name-entries.ts +5 -1
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/function-help.ts +2 -2
- package/src/components/command-bar/pane-settings.ts +2 -2
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/input-search-bar.tsx +9 -2
- package/src/components/layout/pane/header.tsx +2 -0
- package/src/components/layout/shell/pane/capture.ts +4 -1
- package/src/components/layout/status-bar.tsx +6 -1
- package/src/components/onboarding/first-run-workspace.ts +44 -2
- package/src/components/onboarding/onboarding-frame.tsx +11 -2
- package/src/components/onboarding/onboarding-keyboard.ts +16 -0
- package/src/components/onboarding/onboarding-wizard.tsx +8 -8
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
- package/src/components/onboarding/use-onboarding-progress.ts +12 -4
- package/src/components/pane-settings-dialog/desktop.tsx +2 -2
- package/src/components/pane-settings-dialog/tui.tsx +2 -2
- package/src/components/pane-settings-dialog/value.ts +6 -0
- package/src/components/pane-settings-dialog.tsx +3 -3
- package/src/components/reader/detail-reader.tsx +4 -0
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/page-stack-view.tsx +3 -0
- package/src/components/ui/pane-link-chip.tsx +269 -54
- package/src/components/ui/query-bar.tsx +2 -1
- package/src/components/ui/tabs.tsx +97 -19
- package/src/core/state/app/layout-reducer.ts +7 -0
- package/src/core/state/app/layout.ts +44 -7
- package/src/core/state/app/state.ts +1 -1
- package/src/core/state/app/types.ts +22 -2
- package/src/docs/snapshot.json +27 -10
- package/src/market-data/depositary-pair.ts +5 -3
- package/src/market-data/market/dated-previous-close.ts +94 -15
- package/src/market-data/market/status.ts +17 -1
- package/src/plugins/builtin/analytics/risk-client.ts +10 -4
- package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
- package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
- package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
- package/src/plugins/builtin/awards/index.tsx +1 -1
- package/src/plugins/builtin/buildout/index.tsx +1 -0
- package/src/plugins/builtin/catalysts/index.tsx +2 -2
- package/src/plugins/builtin/cds/headless.ts +4 -0
- package/src/plugins/builtin/chart-composer/headless.ts +2 -1
- package/src/plugins/builtin/chart-composer/index.tsx +1 -0
- package/src/plugins/builtin/chat/content/composer.tsx +5 -4
- package/src/plugins/builtin/chat/content/index.tsx +12 -2
- package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
- package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
- package/src/plugins/builtin/chat/layout.ts +5 -2
- package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
- package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
- package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
- package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
- package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +5 -3
- package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
- package/src/plugins/builtin/company-attention/index.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +3 -1
- package/src/plugins/builtin/company-kpis/index.tsx +2 -2
- package/src/plugins/builtin/cot/index.tsx +1 -1
- package/src/plugins/builtin/cpi/index.tsx +1 -1
- package/src/plugins/builtin/crypto-board/index.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
- package/src/plugins/builtin/doe/index.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
- package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
- package/src/plugins/builtin/econ/calendar-model.ts +74 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
- package/src/plugins/builtin/econ/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
- package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
- package/src/plugins/builtin/executives/index.tsx +1 -0
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/fixed-income/index.tsx +1 -0
- package/src/plugins/builtin/futures-curve/headless.ts +3 -3
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +18 -0
- package/src/plugins/builtin/gpu/index.tsx +1 -1
- package/src/plugins/builtin/help/functions-table.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +11 -1
- package/src/plugins/builtin/help/keybindings-editor.tsx +1 -1
- package/src/plugins/builtin/holders/index.tsx +1 -0
- package/src/plugins/builtin/holders/report-header.ts +2 -2
- package/src/plugins/builtin/insider/index.tsx +1 -0
- package/src/plugins/builtin/iv-history/index.tsx +1 -1
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/macro-day/headless.ts +27 -8
- package/src/plugins/builtin/macro-day/index.tsx +1 -1
- package/src/plugins/builtin/macro-day/model.ts +19 -3
- package/src/plugins/builtin/macro-day/pane.tsx +14 -9
- package/src/plugins/builtin/macro-day/releases.ts +25 -7
- package/src/plugins/builtin/market-valuation/index.tsx +1 -0
- package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
- package/src/plugins/builtin/members/index.tsx +1 -1
- package/src/plugins/builtin/mna/index.tsx +1 -0
- package/src/plugins/builtin/news/index.tsx +1 -0
- package/src/plugins/builtin/news/wire/index.tsx +5 -1
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
- package/src/plugins/builtin/options/index.tsx +1 -0
- package/src/plugins/builtin/options-positioning/index.tsx +1 -0
- package/src/plugins/builtin/pe-band/index.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
- package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
- package/src/plugins/builtin/power/index.tsx +1 -1
- package/src/plugins/builtin/realized-vol/index.tsx +1 -1
- package/src/plugins/builtin/research/headless.ts +10 -4
- package/src/plugins/builtin/research/index.tsx +4 -0
- package/src/plugins/builtin/research-search/index.tsx +1 -0
- package/src/plugins/builtin/research-search/pane.tsx +8 -0
- package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- package/src/plugins/builtin/scanner/headless.ts +52 -13
- package/src/plugins/builtin/seasonality/index.tsx +1 -1
- package/src/plugins/builtin/sec/index.tsx +1 -0
- package/src/plugins/builtin/series-inventory.ts +1 -1
- package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
- package/src/plugins/builtin/short-interest/index.tsx +1 -0
- package/src/plugins/builtin/social-mentions/index.tsx +1 -1
- package/src/plugins/builtin/supply-chain/index.tsx +1 -0
- package/src/plugins/builtin/thirteenf/data.ts +43 -10
- package/src/plugins/builtin/thirteenf/headless.ts +55 -11
- package/src/plugins/builtin/thirteenf/model.ts +25 -9
- package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
- package/src/plugins/builtin/thirteenf/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
- package/src/plugins/builtin/ticker-detail/financials/model.ts +12 -0
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +5 -5
- package/src/plugins/builtin/ticker-detail/headless.ts +18 -13
- package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +6 -4
- package/src/plugins/builtin/time-sales/client.ts +9 -11
- package/src/plugins/builtin/time-sales/index.tsx +1 -1
- package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
- package/src/plugins/builtin/treasury-auctions/cache.ts +18 -3
- package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
- package/src/plugins/builtin/treasury-auctions/headless.ts +109 -19
- package/src/plugins/builtin/treasury-auctions/index.tsx +14 -4
- package/src/plugins/builtin/treasury-auctions/model.ts +256 -28
- package/src/plugins/builtin/treasury-auctions/pane.tsx +139 -28
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
- package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
- package/src/plugins/builtin/vol-surface/index.tsx +1 -1
- package/src/plugins/builtin/world-venue-map/index.ts +1 -0
- package/src/plugins/builtin/yield-curve/curves.ts +10 -4
- package/src/plugins/builtin/yield-curve/headless.ts +6 -2
- package/src/plugins/builtin/yield-curve/index.tsx +3 -3
- package/src/plugins/builtin/yield-curve/series.ts +10 -0
- package/src/plugins/builtin/yield-curve/world.ts +3 -1
- package/src/portfolio/column-values.ts +2 -1
- package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
- package/src/public/remote.ts +7 -1
- package/src/remote/client.ts +191 -11
- package/src/remote/controller-utils.ts +13 -1
- package/src/remote/controller.ts +88 -26
- package/src/remote/endpoint.ts +24 -0
- package/src/remote/form.ts +59 -4
- package/src/remote/resources.ts +44 -18
- package/src/remote/schema.ts +21 -9
- package/src/remote/secrets.ts +12 -0
- package/src/remote/semantic-tree.tsx +14 -2
- package/src/remote/server.ts +2 -1
- package/src/remote/surface.tsx +192 -0
- package/src/remote/types.ts +5 -0
- package/src/renderers/opentui/host.tsx +6 -0
- package/src/series/standalone.ts +2 -2
- package/src/shares/api.ts +21 -4
- package/src/shares/item.ts +73 -0
- package/src/shares/pane-item.ts +205 -0
- package/src/shares/pane.ts +4 -0
- package/src/shares/payload.ts +9 -5
- package/src/sources/gloomberb-cloud/news.ts +2 -0
- package/src/tickers/renamed-listings.ts +105 -0
- package/src/tickers/search/index.ts +103 -16
- package/src/time-series/resolve.ts +2 -2
- package/src/types/financials.ts +1 -0
- package/src/types/plugin-pane-settings.ts +2 -0
- package/src/types/plugin-panes.ts +22 -0
- package/src/utils/central-banks.ts +86 -1
- package/src/utils/datetime-format.ts +12 -3
- package/src/utils/depositary-receipt.ts +28 -3
- package/src/utils/fundamentals.ts +14 -0
- package/src/utils/max-drawdown.ts +97 -16
- package/src/utils/untrusted-text.ts +29 -0
|
@@ -434,8 +434,9 @@ interface HoldingLine {
|
|
|
434
434
|
/**
|
|
435
435
|
* Each line's split factor by row id, new shares per old: 1 when its corporate
|
|
436
436
|
* actions show no split between the filings, null when they could not be read.
|
|
437
|
+
* `late` holds the lines left unread because the lookups' time ran out.
|
|
437
438
|
*/
|
|
438
|
-
export type SplitFactors = ReadonlyMap<string, number | null
|
|
439
|
+
export type SplitFactors = ReadonlyMap<string, number | null> & { readonly late?: ReadonlySet<string> };
|
|
439
440
|
|
|
440
441
|
/**
|
|
441
442
|
* The Est P&L of a line held through the quarter, and the value of the shares
|
|
@@ -490,8 +491,13 @@ export interface FilingQuarterReturn {
|
|
|
490
491
|
percent: number | null;
|
|
491
492
|
/** Lines split between the filings, priced on split-adjusted shares, with the new shares per old (10 for 10:1, 0.1 for 1:10). */
|
|
492
493
|
splits: Array<FilingLine & { ratio: number }>;
|
|
493
|
-
/**
|
|
494
|
-
|
|
494
|
+
/**
|
|
495
|
+
* Lines that moved as across a split whose corporate actions could not be read, left out, largest at the
|
|
496
|
+
* quarter's start first; `late` when the lookups' time ran out before them.
|
|
497
|
+
*/
|
|
498
|
+
skipped: Array<FilingLine & { previousValue: number; late?: boolean }>;
|
|
499
|
+
/** What `skipped` weighed in the book at the quarter's start, as a fraction; null when none is left out or the book has no value. */
|
|
500
|
+
skippedShare: number | null;
|
|
495
501
|
}
|
|
496
502
|
|
|
497
503
|
/** The least change in a line's share count that reads as a split: 3:2. */
|
|
@@ -531,7 +537,11 @@ export function formatSplitRatio(ratio: number): string {
|
|
|
531
537
|
* no factor is known.
|
|
532
538
|
*/
|
|
533
539
|
export function filingSplitCandidates(data: FundDetailData): Array<FilingLine & { id: string }> {
|
|
534
|
-
return buildFundHoldingRows(data)
|
|
540
|
+
return buildFundHoldingRows(data)
|
|
541
|
+
.filter((row) => row.splitUnread)
|
|
542
|
+
// Largest at the start of the quarter first: the lines that weigh most on an estimate are read first.
|
|
543
|
+
.sort((a, b) => (b.previousValue ?? 0) - (a.previousValue ?? 0))
|
|
544
|
+
.map((row) => ({ id: row.id, ticker: row.ticker, issuer: row.issuer }));
|
|
535
545
|
}
|
|
536
546
|
|
|
537
547
|
/**
|
|
@@ -551,20 +561,26 @@ export function filingSplitCandidates(data: FundDetailData): Array<FilingLine &
|
|
|
551
561
|
*/
|
|
552
562
|
export function estimateFilingQuarterReturn(data: FundDetailData, splits: SplitFactors = new Map()): FilingQuarterReturn {
|
|
553
563
|
const adjusted: FilingQuarterReturn["splits"] = [];
|
|
554
|
-
const skipped:
|
|
555
|
-
if (!hasComparable13FQuarter(data)) return { percent: null, splits: adjusted, skipped };
|
|
564
|
+
const skipped: FilingQuarterReturn["skipped"] = [];
|
|
565
|
+
if (!hasComparable13FQuarter(data)) return { percent: null, splits: adjusted, skipped, skippedShare: null };
|
|
556
566
|
let pnl = 0;
|
|
557
567
|
let base = 0;
|
|
568
|
+
let book = 0;
|
|
558
569
|
for (const row of buildFundHoldingRows(data)) {
|
|
570
|
+
book += row.previousValue != null && row.previousValue > 0 ? row.previousValue : 0;
|
|
559
571
|
const estimate = estimateHolding(row, splits);
|
|
560
572
|
const line = { ticker: row.ticker, issuer: row.issuer };
|
|
561
|
-
if (estimate.kind === "unread")
|
|
573
|
+
if (estimate.kind === "unread") {
|
|
574
|
+
skipped.push({ ...line, previousValue: row.previousValue ?? 0, ...(splits.late?.has(row.id) ? { late: true } : {}) });
|
|
575
|
+
}
|
|
562
576
|
if (estimate.kind !== "priced") continue;
|
|
563
577
|
if (estimate.ratio !== 1) adjusted.push({ ...line, ratio: estimate.ratio });
|
|
564
578
|
pnl += estimate.pnl;
|
|
565
579
|
base += estimate.base;
|
|
566
580
|
}
|
|
567
|
-
|
|
581
|
+
skipped.sort((left, right) => right.previousValue - left.previousValue);
|
|
582
|
+
const left = skipped.reduce((sum, line) => sum + line.previousValue, 0);
|
|
583
|
+
return { percent: base > 0 ? (pnl / base) * 100 : null, splits: adjusted, skipped, skippedShare: skipped.length && book > 0 ? left / book : null };
|
|
568
584
|
}
|
|
569
585
|
|
|
570
586
|
export function hasComparable13FQuarter(data: FundDetailData): boolean {
|
|
@@ -672,7 +688,7 @@ export function buildFundHoldingRows(data: FundDetailData | null, splits?: Split
|
|
|
672
688
|
valueChange,
|
|
673
689
|
estimatedPnl: estimate.kind === "priced" ? estimate.pnl : null,
|
|
674
690
|
...(ratio !== 1 ? { splitRatio: ratio } : {}),
|
|
675
|
-
...(estimate.kind === "unread" ? { splitUnread: true } : {}),
|
|
691
|
+
...(estimate.kind === "unread" ? { splitUnread: true, ...(splits?.late?.has(id) ? { splitLate: true } : {}) } : {}),
|
|
676
692
|
sharesChange,
|
|
677
693
|
sharesChangePercent,
|
|
678
694
|
action: comparable ? resolveAction(currentHolding, previousHolding, ratio) : "unknown",
|
|
@@ -140,19 +140,40 @@ export function splitAdjustedText(lines: readonly (SplitLine & { ratio: number }
|
|
|
140
140
|
return `${prefix}: ${listedLines(lines, (line) => `${lineName(line)} ${formatSplitRatio(line.ratio)}`)} (split between the filings, as the corporate actions show)`;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
/**
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
/** Why lines that moved as across a split have no figure: their corporate actions could not be read, or the time to read them ran out. */
|
|
144
|
+
function unreadReason(lines: readonly (SplitLine & { late?: boolean })[]): string {
|
|
145
|
+
const late = lines.filter((line) => line.late).length;
|
|
146
|
+
const failed = lines.length - late;
|
|
147
|
+
if (late === 0) return "the corporate actions could not be read to tell";
|
|
148
|
+
if (failed === 0) return "the report ran out of time before reading their corporate actions";
|
|
149
|
+
return `the report ran out of time before reading the corporate actions of ${count(late)}; those of ${count(failed)} could not be read`;
|
|
146
150
|
}
|
|
147
151
|
|
|
152
|
+
/** "4.2%" of a book, or "under 0.1%". */
|
|
153
|
+
function bookShareText(share: number): string {
|
|
154
|
+
return share < 0.001 ? "under 0.1%" : `${(share * 100).toFixed(1)}%`;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* "No Est P&L: XYZ (shares and value per share moved as across a split, and the corporate actions could not be
|
|
159
|
+
* read to tell)": lines left without a figure, in the order given (largest first), `leftOut` opening it, and with
|
|
160
|
+
* `bookShare` what they weighed in the book at the quarter's start.
|
|
161
|
+
*/
|
|
162
|
+
export function splitUnreadText(lines: readonly (SplitLine & { late?: boolean })[], leftOut: string, bookShare?: number | null): string {
|
|
163
|
+
const share = bookShare != null && bookShare > 0 ? `, ${bookShareText(bookShare)} of the book at the quarter's start` : "";
|
|
164
|
+
return `${leftOut}${share}: ${listedLines(lines, lineName)} (shares and value per share moved as across a split, and ${unreadReason(lines)})`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
type UnreadRow = SplitLine & { splitUnread?: boolean; splitLate?: boolean };
|
|
168
|
+
|
|
148
169
|
/** The note for the lines of a Holdings table left without an Est P&L because their split could not be confirmed: a data limitation, the pane's notice as well as the report's. */
|
|
149
|
-
export function holdingUnreadNotes(rows: readonly
|
|
150
|
-
const unread = rows.filter((row) => row.splitUnread);
|
|
170
|
+
export function holdingUnreadNotes(rows: readonly UnreadRow[]): string[] {
|
|
171
|
+
const unread = rows.filter((row) => row.splitUnread).map((row) => ({ ...row, late: row.splitLate }));
|
|
151
172
|
return unread.length ? [splitUnreadText(unread, "No Est P&L")] : [];
|
|
152
173
|
}
|
|
153
174
|
|
|
154
175
|
/** What a Holdings report says of its lines that moved as across a split: the ones priced split-adjusted (method, so a report's note only), and the ones left without a figure. */
|
|
155
|
-
export function holdingSplitNotes(rows: readonly (
|
|
176
|
+
export function holdingSplitNotes(rows: readonly (UnreadRow & { splitRatio?: number })[]): string[] {
|
|
156
177
|
const adjusted = rows.flatMap((row) => row.splitRatio ? [{ ...row, ratio: row.splitRatio }] : []);
|
|
157
178
|
return [...(adjusted.length ? [splitAdjustedText(adjusted, "Est P&L split-adjusted")] : []), ...holdingUnreadNotes(rows)];
|
|
158
179
|
}
|
|
@@ -195,6 +195,8 @@ export interface FundHoldingRow {
|
|
|
195
195
|
splitRatio?: number;
|
|
196
196
|
/** The line moved as across a split and its corporate actions could not be read to tell: Est P&L is left empty, not priced as a crash or a surge, and its share change stays as filed. */
|
|
197
197
|
splitUnread?: boolean;
|
|
198
|
+
/** With `splitUnread`: the lookups' time ran out before its corporate actions were read. */
|
|
199
|
+
splitLate?: boolean;
|
|
198
200
|
sharesChange: number | null;
|
|
199
201
|
sharesChangePercent: number | null;
|
|
200
202
|
action: HoldingAction;
|
|
@@ -90,7 +90,7 @@ export function adrPairFigures(comparison: DepositaryPairComparison): AdrPairFig
|
|
|
90
90
|
value: comparison.premiumPercent == null ? "—" : premiumText(comparison.premiumPercent),
|
|
91
91
|
...(comparison.premiumPercent == null ? {} : { detail: "at spot" }),
|
|
92
92
|
},
|
|
93
|
-
{ id: "ratio", label: "Ratio", value: adrRatioText(comparison.ratio) ?? `1:${ratioCount(comparison.ratio)}` },
|
|
93
|
+
{ id: "ratio", label: "Ratio", value: adrRatioText(comparison.ratio, comparison.home.symbol) ?? `1:${ratioCount(comparison.ratio)}` },
|
|
94
94
|
];
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -99,6 +99,18 @@ export function statementMetricValue(
|
|
|
99
99
|
|
|
100
100
|
export const FINANCIAL_COL_W = 18;
|
|
101
101
|
export const FINANCIAL_LABEL_W = 28;
|
|
102
|
+
const FINANCIAL_LABEL_MIN_W = 12;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The metric column's width in a table `width` cells wide: 28 where a period
|
|
106
|
+
* fits beside it, narrower (down to 12, labels cut with an ellipsis) where it
|
|
107
|
+
* would otherwise take every value off screen, as a 36-column Financials pane
|
|
108
|
+
* once showed nothing but metric names and "more →". The other 6 cells are the
|
|
109
|
+
* pane's padding, the table's, the column gap and the scrollbar.
|
|
110
|
+
*/
|
|
111
|
+
export function financialLabelWidth(width: number): number {
|
|
112
|
+
return Math.max(FINANCIAL_LABEL_MIN_W, Math.min(FINANCIAL_LABEL_W, width - FINANCIAL_COL_W - 6));
|
|
113
|
+
}
|
|
102
114
|
const FINANCIAL_GROWTH_W = 7;
|
|
103
115
|
const FINANCIAL_VALUE_W = FINANCIAL_COL_W - FINANCIAL_GROWTH_W;
|
|
104
116
|
|
|
@@ -12,7 +12,7 @@ import type { PricePoint } from "../../../../types/financials";
|
|
|
12
12
|
import { padTo } from "../../../../utils/format";
|
|
13
13
|
import { useBoundTicker, useTickerRequest } from "../../shared/ticker-request";
|
|
14
14
|
import type { FinancialTableStatement } from "./aggregation";
|
|
15
|
-
import { FINANCIAL_COL_W,
|
|
15
|
+
import { FINANCIAL_COL_W, financialLabelWidth } from "./model";
|
|
16
16
|
import { loadPeriodEndHistory } from "./period-end-history";
|
|
17
17
|
import {
|
|
18
18
|
formatRatioInput,
|
|
@@ -170,6 +170,6 @@ export function RatioTable({
|
|
|
170
170
|
);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
export function ratioMetricColumn(): RatioTableColumn {
|
|
174
|
-
return { id: "metric", kind: "metric", label: "Ratio", width:
|
|
173
|
+
export function ratioMetricColumn(width: number): RatioTableColumn {
|
|
174
|
+
return { id: "metric", kind: "metric", label: "Ratio", width: financialLabelWidth(width), align: "left" };
|
|
175
175
|
}
|
|
@@ -19,7 +19,7 @@ import { padTo } from "../../../../utils/format";
|
|
|
19
19
|
import { filledPeriodsNote, stalePeriodNote } from "../../../../utils/financial-statements";
|
|
20
20
|
import {
|
|
21
21
|
FINANCIAL_COL_W,
|
|
22
|
-
|
|
22
|
+
financialLabelWidth,
|
|
23
23
|
FINANCIAL_SUB_TABS,
|
|
24
24
|
buildFinancialRows,
|
|
25
25
|
canCompareFinancialRow,
|
|
@@ -305,7 +305,7 @@ export function ResolvedFinancialsTab({
|
|
|
305
305
|
id: "metric",
|
|
306
306
|
kind: "metric",
|
|
307
307
|
label: "Metric",
|
|
308
|
-
width:
|
|
308
|
+
width: financialLabelWidth(width),
|
|
309
309
|
align: "left",
|
|
310
310
|
},
|
|
311
311
|
...displayStatements.map((statement, index): FinancialTableColumn => ({
|
|
@@ -323,7 +323,7 @@ export function ResolvedFinancialsTab({
|
|
|
323
323
|
align: "right",
|
|
324
324
|
headerColor: statement.date === "TTM" ? colors.textBright : colors.textDim,
|
|
325
325
|
})),
|
|
326
|
-
], [annualDates, comparisonCurrency, displayStatements, isAnnual, yearEndMonth]);
|
|
326
|
+
], [annualDates, comparisonCurrency, displayStatements, isAnnual, width, yearEndMonth]);
|
|
327
327
|
const { rows, unit } = useMemo(
|
|
328
328
|
() => shareFinancialUnit(buildFinancialRows(subTab.rows, displayStatements, collapsedGroups)),
|
|
329
329
|
[collapsedGroups, displayStatements, subTab.rows],
|
|
@@ -440,9 +440,9 @@ export function ResolvedFinancialsTab({
|
|
|
440
440
|
isValuation, quarterlyStatements, ratioTab, resolvedPeriod, financials?.profile,
|
|
441
441
|
]);
|
|
442
442
|
const ratioColumns = useMemo<RatioTableColumn[]>(() => [
|
|
443
|
-
ratioMetricColumn(),
|
|
443
|
+
ratioMetricColumn(width),
|
|
444
444
|
...columns.flatMap((column, index) => column.kind === "statement" ? [{ ...column, index: index - 1 }] : []),
|
|
445
|
-
], [columns]);
|
|
445
|
+
], [columns, width]);
|
|
446
446
|
|
|
447
447
|
// The Balance Sheet and Liquidity show cash, which an offering filed since the latest balance sheet is not in yet.
|
|
448
448
|
const { symbol: boundSymbol, exchange: boundExchange } = useBoundTicker();
|
|
@@ -45,7 +45,9 @@ import {
|
|
|
45
45
|
quotedPriceDivisor,
|
|
46
46
|
} from "../../../cli/history-rows";
|
|
47
47
|
import { formatUtcTime } from "../../../utils/utc-time";
|
|
48
|
-
import {
|
|
48
|
+
import { closeMoves } from "../../../utils/max-drawdown";
|
|
49
|
+
import { isYieldIndexSymbol } from "../../../tickers/index-roots";
|
|
50
|
+
import { parsePublicTickerKey } from "../../../utils/exchanges";
|
|
49
51
|
import { isPastPriceWindow, loadPriceWindowHistory, priceWindowText, readPriceWindow, type PriceWindow } from "../../../utils/price-window";
|
|
50
52
|
import { historyCoverageNotice } from "../../../sources/history-coverage";
|
|
51
53
|
import { getChartResolutionLabel, isIntradayResolution, RANGE_HISTORY_RESOLUTION, type ManualChartResolution } from "../../../time-series/resolution";
|
|
@@ -111,7 +113,8 @@ export const financialStatementsHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
111
113
|
const receiptPeriods = table?.statements.filter(({ shareBasis }) => shareBasis === "depositary_receipt").map(({ date }) => date) ?? [];
|
|
112
114
|
const allReceipts = receiptPeriods.length > 0 && receiptPeriods.length === table?.statements.length;
|
|
113
115
|
const shareBases = new Set(table?.statements.map(({ shareBasis }) => shareBasis ?? null));
|
|
114
|
-
const ratio = adrRatioText(financials.fundamentals?.adrRatio ?? financials.quote?.adrRatio
|
|
116
|
+
const ratio = adrRatioText(financials.fundamentals?.adrRatio ?? financials.quote?.adrRatio,
|
|
117
|
+
(financials.fundamentals?.depositaryPair ?? financials.quote?.depositaryPair)?.ordinary[0]);
|
|
115
118
|
const shareBasisNotice = receiptPeriods.length === 0 || !table?.rows.some(isPerShareFinancialRow) ? null
|
|
116
119
|
: allReceipts
|
|
117
120
|
? `Share counts are in ADRs and EPS is per ADR${ratio ? `; ${ratio}` : ""}.`
|
|
@@ -461,13 +464,12 @@ export const historicalPricesHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
461
464
|
...(forming ? { periodToDate: forming } : closedDay ? { asOf: closedDay } : quotedAt ? { asOf: quotedAt } : {}),
|
|
462
465
|
...(dayToDate ? { basis: "daily bars", note: `the newest bar is ${DAY_SO_FAR_TEXT}`, ...(quote ? { asOf: new Date(quote.lastUpdated).toISOString() } : {}) } : {}),
|
|
463
466
|
};
|
|
464
|
-
// The largest fall from a close to a later one in the bars shown, said under the title.
|
|
465
|
-
const drawdown =
|
|
466
|
-
|
|
467
|
-
date: (value) => isDailyOrLongerBar(size) ? value.slice(0, 10) : formatUtcTime(value) }) : null;
|
|
467
|
+
// The largest fall from a close to a later one in the bars shown, said under the title; a yield's in bp, with its largest rise.
|
|
468
|
+
const { drawdown, runUp, lines: moveLines } = closeMoves(shown, drawdownScaleOf(symbol), { basis: `${historyBarSizeWord(size)} closes`,
|
|
469
|
+
price: (value) => formatBarPrice(value, decimals), date: (value) => isDailyOrLongerBar(size) ? value.slice(0, 10) : formatUtcTime(value) });
|
|
468
470
|
// A wick left out of the range is said, though the bar's close still counts.
|
|
469
471
|
const wickNotice = priceHistoryWickNotice(points.filter((point) => pricePointWickFlags(point).length > 0).length);
|
|
470
|
-
const reportNotices = [
|
|
472
|
+
const reportNotices = [...moveLines, notice, wickNotice].filter((line): line is string => line != null);
|
|
471
473
|
return {
|
|
472
474
|
rows: shown,
|
|
473
475
|
columns: historyColumns(size, marked, false, false, decimals),
|
|
@@ -478,7 +480,7 @@ export const historicalPricesHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
478
480
|
...(notice ? { complete: false } : {}),
|
|
479
481
|
unavailableSymbols: rows.some((row) => row.close !== null) ? [] : [symbol],
|
|
480
482
|
metadata: { symbol, range: window ? null : range, ...(window ? { requestedWindow: window } : {}), ...(size === "intraday" ? {} : { interval: size }),
|
|
481
|
-
...(allStart ? { sourceStart: allStart } : {}), maxDrawdown: drawdown,
|
|
483
|
+
...(allStart ? { sourceStart: allStart } : {}), maxDrawdown: drawdown, ...(runUp ? { maxRunUp: runUp } : {}),
|
|
482
484
|
...(reportNotices.length ? { notices: reportNotices } : {}) },
|
|
483
485
|
};
|
|
484
486
|
},
|
|
@@ -535,10 +537,9 @@ export const returnsHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
535
537
|
const dayToDate = isTodayReturnRow(returns.at(-1), series.resolution, venue, now);
|
|
536
538
|
const rows = forming || dayToDate ? [...unmarked.slice(0, -1), { ...unmarked.at(-1)!, partial: true }] : unmarked;
|
|
537
539
|
const price = (value: unknown) => typeof value === "number" && Number.isFinite(value) ? value.toFixed(decimals) : "-";
|
|
538
|
-
// The largest fall from a close to a later one in the window, said under the title.
|
|
539
|
-
const drawdown =
|
|
540
|
-
|
|
541
|
-
date: (value) => intraday ? formatUtcTime(value) : value.slice(0, 10) }) : null;
|
|
540
|
+
// The largest fall from a close to a later one in the window, said under the title; a yield's in bp, with its largest rise.
|
|
541
|
+
const { drawdown, runUp, lines: moveLines } = closeMoves(unmarked.map((row) => ({ date: row.time, close: row.close })), drawdownScaleOf(symbol),
|
|
542
|
+
{ basis: `${BAR_INTERVAL_LABELS[series.resolution]} closes`, price, date: (value) => intraday ? formatUtcTime(value) : value.slice(0, 10) });
|
|
542
543
|
const figures: HeadlessPaneColumn[] = [
|
|
543
544
|
{ key: "close", header: "Price", align: "right", format: price },
|
|
544
545
|
{ key: "intervalChange", header: "Int $", align: "right", format: price },
|
|
@@ -565,7 +566,7 @@ export const returnsHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
565
566
|
const textColumns: HeadlessPaneColumn[] = [timeColumn(true), ...textFigures];
|
|
566
567
|
// An interval the range is too long for is served in the nearest longer bar; say so rather than switch silently.
|
|
567
568
|
const notices = [
|
|
568
|
-
|
|
569
|
+
...moveLines,
|
|
569
570
|
baseDay ? `Totals ${periodBaseText(baseDay, now)}.` : null,
|
|
570
571
|
series.resolution !== requested
|
|
571
572
|
? `${getChartResolutionLabel(requested)} bars do not ${window ? `cover ${priceWindowText(window)}` : `reach back ${range}`}; these are ${getChartResolutionLabel(series.resolution)} bars.`
|
|
@@ -605,8 +606,12 @@ export const returnsHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
605
606
|
...(series.lastSession ? { marketClosed: true, lastSession: series.lastSession } : {}),
|
|
606
607
|
basis: "Price returns of bar closes; dividends are not included",
|
|
607
608
|
maxDrawdown: drawdown,
|
|
609
|
+
...(runUp ? { maxRunUp: runUp } : {}),
|
|
608
610
|
...(notices.length ? { notices } : {}),
|
|
609
611
|
},
|
|
610
612
|
};
|
|
611
613
|
},
|
|
612
614
|
};
|
|
615
|
+
|
|
616
|
+
/** A Cboe yield index (^TNX) moves by its level, in bp; anything else by its return. */
|
|
617
|
+
const drawdownScaleOf = (symbol: string) => isYieldIndexSymbol(parsePublicTickerKey(symbol).symbol) ? "yield" as const : "return" as const;
|
|
@@ -45,6 +45,7 @@ export const tickerDetailModule: PluginModule = {
|
|
|
45
45
|
icon: "D",
|
|
46
46
|
get component(): typeof import("./pane").TickerResearchPane { const { TickerResearchPane } = require("./pane"); return TickerResearchPane; },
|
|
47
47
|
defaultPosition: "right",
|
|
48
|
+
shareItem: { ticker: true },
|
|
48
49
|
tickerFollower: true,
|
|
49
50
|
// DES and ADR open this pane; ADR's window is named by its params (the tab it asked for), so settings never say whose a window is.
|
|
50
51
|
identitySettings: [],
|
|
@@ -71,6 +72,7 @@ export const tickerDetailModule: PluginModule = {
|
|
|
71
72
|
get component(): typeof import("./financials/pane").FinancialAnalysisPane { const { FinancialAnalysisPane } = require("./financials/pane"); return FinancialAnalysisPane; },
|
|
72
73
|
headless: financialStatementsHeadless,
|
|
73
74
|
defaultPosition: "right",
|
|
75
|
+
shareItem: { ticker: true },
|
|
74
76
|
tickerFollower: true,
|
|
75
77
|
defaultMode: "floating",
|
|
76
78
|
defaultFloatingSize: { width: 98, height: 30 },
|
|
@@ -100,6 +102,7 @@ export const tickerDetailModule: PluginModule = {
|
|
|
100
102
|
get component(): typeof import("./data-panes/historical-prices").HistoricalPricesPane { const { HistoricalPricesPane } = require("./data-panes/historical-prices"); return HistoricalPricesPane; },
|
|
101
103
|
headless: historicalPricesHeadless,
|
|
102
104
|
defaultPosition: "right",
|
|
105
|
+
shareItem: { ticker: true },
|
|
103
106
|
tickerFollower: true,
|
|
104
107
|
defaultMode: "floating",
|
|
105
108
|
defaultFloatingSize: { width: 92, height: 26 },
|
|
@@ -113,6 +116,7 @@ export const tickerDetailModule: PluginModule = {
|
|
|
113
116
|
get component(): typeof import("./data-panes/returns-pane").ReturnsPane { const { ReturnsPane } = require("./data-panes/returns-pane"); return ReturnsPane; },
|
|
114
117
|
headless: returnsHeadless,
|
|
115
118
|
defaultPosition: "right",
|
|
119
|
+
shareItem: { ticker: true },
|
|
116
120
|
tickerFollower: true,
|
|
117
121
|
defaultMode: "floating",
|
|
118
122
|
defaultFloatingSize: { width: 100, height: 28 },
|
|
@@ -31,7 +31,7 @@ import { getPortfolioPositionMetrics, getPortfolioQuoteDisplay, resolvePortfolio
|
|
|
31
31
|
import { listingDividendYield, liveForwardPE, liveMarketCapitalization, liveTrailingPE } from "../../../../market-data/quotes/live-valuation";
|
|
32
32
|
import { atRegularSessionPrice } from "../../../../market-data/quotes/regular-session-valuation";
|
|
33
33
|
import { formatReportedMoney, REPORTING_CURRENCY_NOT_SOURCED } from "../../../../utils/reported-money";
|
|
34
|
-
import { enterpriseValueCheck, enterpriseValueNotMeaningful, fundamentalsCurrency, isBankEnterpriseValue, fundamentalsEpsCurrency, reportedEnterpriseValue } from "../../../../utils/fundamentals";
|
|
34
|
+
import { enterpriseValueCheck, enterpriseValueGapIsLarge, enterpriseValueNotMeaningful, fundamentalsCurrency, isBankEnterpriseValue, fundamentalsEpsCurrency, reportedEnterpriseValue } from "../../../../utils/fundamentals";
|
|
35
35
|
import { formatShortDate } from "../../../../utils/datetime-format";
|
|
36
36
|
import { safeExternalUrl } from "../../../../utils/external-url";
|
|
37
37
|
import type { FundBondFacts } from "../../../../api-client/fund-facts";
|
|
@@ -232,7 +232,7 @@ export function buildOverviewStats({
|
|
|
232
232
|
const { pair, receiptSide } = depositaryPair;
|
|
233
233
|
const count = ratioCount(pair.ratio);
|
|
234
234
|
stats.push(receiptSide
|
|
235
|
-
? { label: "ADR Ratio", value: `1:${count}`, detail: [adrRatioText(pair.ratio)!, `${count} sh per ADR`], link: ADR_PAIR }
|
|
235
|
+
? { label: "ADR Ratio", value: `1:${count}`, detail: [adrRatioText(pair.ratio, pair.ordinary[0])!, `${count} sh per ADR`], link: ADR_PAIR }
|
|
236
236
|
: { label: "ADR", value: pair.receipt, detail: [`1 ADR = ${count} of these shares`, `1:${count}`], link: ADR_PAIR });
|
|
237
237
|
}
|
|
238
238
|
if (cedearRatio) {
|
|
@@ -334,9 +334,11 @@ export function buildOverviewStats({
|
|
|
334
334
|
} else if (fundamentals?.unavailableFields?.includes("enterpriseValue")) {
|
|
335
335
|
stats.push({ label: "EV", value: "—" });
|
|
336
336
|
} else if (enterpriseValue != null) {
|
|
337
|
-
// More than
|
|
337
|
+
// More than 10% from market cap + debt - cash: the provider's, with the computed figure where it fits.
|
|
338
|
+
// Closer than that it is the valuation panes' detail (enterpriseValueGapIsLarge).
|
|
338
339
|
const check = enterpriseValueCheck(priced);
|
|
339
|
-
const computed = check?.status === "differs" && check.computed != null
|
|
340
|
+
const computed = check?.status === "differs" && check.computed != null && enterpriseValueGapIsLarge(priced)
|
|
341
|
+
? formatCompact(check.computed) : undefined;
|
|
340
342
|
stats.push({
|
|
341
343
|
label: "EV",
|
|
342
344
|
value: formatCompactCurrency(enterpriseValue, quoteCurrency),
|
|
@@ -38,7 +38,7 @@ import type { TickerRecord } from "../../../types/ticker";
|
|
|
38
38
|
import { Box, ScrollBox, Text, useUiCapabilities } from "../../../ui";
|
|
39
39
|
import { publicTickerKey, resolveExchangeTimeZone } from "../../../utils/exchanges";
|
|
40
40
|
import { convertCurrency, displayWidth, formatPercentRaw, truncateToDisplayWidth } from "../../../utils/format";
|
|
41
|
-
import { appTtmRate, enterpriseValueReconciliationNote, ttmAtAppRate, ttmConversionNote, withBankEnterpriseValue } from "../../../utils/fundamentals";
|
|
41
|
+
import { appTtmRate, enterpriseValueGapIsLarge, enterpriseValueReconciliationNote, ttmAtAppRate, ttmConversionNote, withBankEnterpriseValue } from "../../../utils/fundamentals";
|
|
42
42
|
import { atRegularSessionPrice } from "../../../market-data/quotes/regular-session-valuation";
|
|
43
43
|
import { zonedDateKey } from "../../../utils/zoned-date-time";
|
|
44
44
|
import { sharesOutstandingInReceipts } from "../../../utils/depositary-receipt";
|
|
@@ -250,9 +250,11 @@ function ResolvedOverviewTab({ width, height, focused = false, ticker, financial
|
|
|
250
250
|
panelId: "price",
|
|
251
251
|
timeBasis: chartTimeZone ? { kind: "market", timeZone: chartTimeZone } : undefined,
|
|
252
252
|
});
|
|
253
|
-
// A provider EV off market cap + debt - cash, or why a withdrawn one is unavailable, at the
|
|
254
|
-
// regular session price the EV beside it is shown at.
|
|
255
|
-
const
|
|
253
|
+
// A provider EV well off market cap + debt - cash, or why a withdrawn one is unavailable, at the
|
|
254
|
+
// regular session price the EV beside it is shown at. A gap of a few percent is the valuation panes' detail.
|
|
255
|
+
const pricedForEnterpriseValue = atRegularSessionPrice({ quote, fundamentals: withBankEnterpriseValue(fundamentals, profile) }).fundamentals;
|
|
256
|
+
const enterpriseValueNote = enterpriseValueGapIsLarge(pricedForEnterpriseValue)
|
|
257
|
+
? enterpriseValueReconciliationNote(pricedForEnterpriseValue) : undefined;
|
|
256
258
|
// Months of cash, for a company that burns it, and an offering since its balance sheet that the cash is not in yet.
|
|
257
259
|
const runway = useMemo(() => financials ? cashRunway(financials) : null, [financials]);
|
|
258
260
|
const runwayOfferingNote = useOfferingNote(ticker.metadata.ticker, ticker.metadata.exchange, runway?.periodEnd ?? null, runway?.trailing?.kind === "months");
|
|
@@ -61,25 +61,23 @@ export function validateTape(data: TapeSnapshot, symbol: string, exchange: strin
|
|
|
61
61
|
/** The latest tape, or with a `range` that window of the session. */
|
|
62
62
|
export async function fetchTape(symbol: string, exchange: string, signal?: AbortSignal,
|
|
63
63
|
client: Pick<typeof apiClient, "getCloudTape"> = apiClient, range?: TapeRange): Promise<TapeSnapshot> {
|
|
64
|
-
|
|
64
|
+
// The tape names US venues by their codes: a listing found as NYSEARCA is asked as ARCA, as it is answered.
|
|
65
|
+
const venue = canonicalExchange(exchange);
|
|
66
|
+
try { return validateTape(await (range ? client.getCloudTape(symbol, venue, signal, range) : client.getCloudTape(symbol, venue, signal)), symbol, exchange); }
|
|
65
67
|
catch (error) {
|
|
66
68
|
if (error instanceof ApiRequestError && [404, 503].includes(error.status ?? 0)) throw new Error("Time and sales is not available yet.");
|
|
67
69
|
// A rejected request answers with an unavailable snapshot; show its reason, not the JSON body.
|
|
68
70
|
if (error instanceof ApiRequestError) {
|
|
69
|
-
const reason =
|
|
71
|
+
const reason = tapeGap(error.details);
|
|
70
72
|
if (reason) throw new Error(reason);
|
|
71
73
|
}
|
|
72
74
|
throw error;
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
/** The first stated gap of an unavailable tape snapshot
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return Array.isArray(value?.gaps) && typeof value.gaps[0] === "string" ? value.gaps[0] : null;
|
|
81
|
-
} catch {
|
|
82
|
-
// Intentional ignore: an error body that is not JSON names no gap, so the request's own error stands.
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
78
|
+
/** The first stated gap of an unavailable tape snapshot, as the request's parsed error body holds it. */
|
|
79
|
+
function tapeGap(details: Readonly<Record<string, unknown>> | undefined): string | null {
|
|
80
|
+
const gaps = details?.gaps;
|
|
81
|
+
return Array.isArray(gaps) && typeof gaps[0] === "string" ? gaps[0] : null;
|
|
85
82
|
}
|
|
83
|
+
|
|
@@ -3,7 +3,7 @@ import { createTickerSurfacePaneTemplate } from "../shared/ticker-surface";
|
|
|
3
3
|
import { quoteRecapHeadless, timeSalesHeadless } from "./headless";
|
|
4
4
|
export const timeSalesModule: PluginModule = {
|
|
5
5
|
panes: [{ id: "time-sales", name: "Time and Sales", icon: "T", get component(): typeof import("./pane").TimeSalesPane { const { TimeSalesPane } = require("./pane"); return TimeSalesPane; },
|
|
6
|
-
defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 104, height: 28 },
|
|
6
|
+
defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 104, height: 28 },
|
|
7
7
|
tableExport: true, headless: timeSalesHeadless, settings: { title: "Time and Sales", fields: [{ key: "tab", label: "View", type: "select", options: [{ value: "trades", label: "Trades" }, { value: "quotes", label: "NBBO" }] }] } }],
|
|
8
8
|
paneTemplates: [
|
|
9
9
|
{ ...createTickerSurfacePaneTemplate({ id: "time-sales-tas", paneId: "time-sales", label: "Time and Sales",
|