gloomberb 0.20.4 → 0.20.6
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 +3 -1
- package/README.zh-CN.md +1 -1
- package/bin/gloom +9 -0
- package/bin/without-bun.cjs +98 -0
- package/package.json +4 -1
- package/src/api-client/data.ts +148 -37
- package/src/api-client/hk-tenders.ts +59 -0
- package/src/api-client/index.ts +1 -0
- package/src/api-client/types/econ.ts +30 -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/app.tsx +18 -13
- package/src/architecture/floating-promise-allowlist.json +313 -0
- 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 +238 -57
- package/src/cli/commands/news-search.ts +81 -14
- package/src/cli/commands/overview.ts +27 -6
- package/src/cli/commands/remote.ts +16 -17
- package/src/cli/commands/system.ts +1 -1
- package/src/cli/commands/ticker.ts +3 -1
- package/src/cli/early-command.ts +2 -0
- package/src/cli/errors.ts +10 -1
- package/src/cli/fx-forward.ts +89 -7
- package/src/cli/fx-pair.ts +1 -1
- package/src/cli/fx-quote-rate.ts +23 -0
- package/src/cli/glossary.ts +19 -5
- package/src/cli/help.ts +1 -0
- package/src/cli/history-rows.ts +5 -3
- package/src/cli/index-roots.ts +5 -4
- package/src/cli/index.ts +40 -3
- package/src/cli/known-gaps.ts +38 -9
- package/src/cli/listing-arg.ts +17 -5
- package/src/cli/name-entries.ts +5 -1
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/options.ts +52 -3
- package/src/cli/output-file.ts +5 -3
- package/src/cli/pane-functions/catalog.ts +15 -0
- package/src/cli/pane-functions/function-help.ts +4 -4
- package/src/cli/pane-functions/headless.ts +9 -4
- package/src/cli/pane-functions/index.ts +6 -4
- package/src/cli/pane-functions/resolver.ts +2 -2
- package/src/cli/result.ts +21 -2
- package/src/cli/spreadsheet-hint.ts +7 -3
- package/src/cli/treasury-yields.ts +5 -3
- package/src/components/chart/composite/legend.tsx +40 -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/command-bar/workflow/tickers.ts +2 -2
- package/src/components/data-table/view.tsx +9 -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/data-table/opentui/index.tsx +11 -4
- package/src/components/ui/data-table/opentui/model.ts +8 -6
- package/src/components/ui/data-table/types.ts +6 -1
- 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/table-layout.ts +38 -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 +30 -13
- package/src/market-data/depositary-pair.ts +5 -3
- package/src/market-data/market/change-basis.ts +9 -5
- package/src/market-data/market/dated-previous-close.ts +147 -17
- package/src/market-data/market/status.ts +17 -1
- package/src/market-data/quotes/contributions.ts +2 -0
- package/src/market-data/quotes/listing-enterprise-value.ts +50 -0
- package/src/plugins/builtin/alerts/metric-data.ts +15 -2
- 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/backtest/headless.ts +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/cds/model.ts +0 -6
- package/src/plugins/builtin/chart-composer/formula.ts +16 -3
- package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -0
- package/src/plugins/builtin/chart-composer/headless.ts +4 -2
- package/src/plugins/builtin/chart-composer/index.tsx +1 -0
- package/src/plugins/builtin/chart-composer/presets.ts +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/pane.tsx +55 -13
- 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/credit-boards/cdx-pane.tsx +20 -7
- package/src/plugins/builtin/credit-boards/client.ts +8 -0
- package/src/plugins/builtin/credit-boards/headless.ts +4 -1
- package/src/plugins/builtin/credit-boards/model.ts +58 -4
- package/src/plugins/builtin/credit-boards/series.ts +63 -6
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +3 -2
- package/src/plugins/builtin/credit-conditions/headless.ts +24 -6
- package/src/plugins/builtin/credit-conditions/index.tsx +1 -1
- package/src/plugins/builtin/credit-conditions/model.ts +12 -6
- package/src/plugins/builtin/credit-conditions/series.ts +2 -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 +115 -8
- package/src/plugins/builtin/econ/calendar-source.ts +7 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
- package/src/plugins/builtin/econ/index.tsx +42 -8
- package/src/plugins/builtin/econ/types.ts +3 -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 +3 -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/fx-matrix/index.tsx +44 -14
- 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 +7 -3
- 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/cli/render.ts +20 -3
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +5 -1
- 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-schema.ts +4 -3
- package/src/plugins/builtin/research/headless.ts +10 -4
- package/src/plugins/builtin/research/index.tsx +4 -0
- package/src/plugins/builtin/research/relative-valuation-columns.ts +145 -47
- package/src/plugins/builtin/research/relative-valuation-currency.ts +31 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +25 -8
- package/src/plugins/builtin/research/relative-valuation-model.ts +40 -9
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +3 -2
- package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -2
- 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/api.ts +47 -4
- 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/data-panes/historical-prices.tsx +8 -7
- package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +8 -5
- package/src/plugins/builtin/ticker-detail/financials/model.ts +18 -2
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +6 -6
- package/src/plugins/builtin/ticker-detail/headless.ts +24 -17
- 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 +54 -5
- package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
- package/src/plugins/builtin/treasury-auctions/headless.ts +150 -22
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +126 -0
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +347 -0
- package/src/plugins/builtin/treasury-auctions/hk.ts +363 -0
- package/src/plugins/builtin/treasury-auctions/index.tsx +27 -4
- package/src/plugins/builtin/treasury-auctions/model.ts +264 -28
- package/src/plugins/builtin/treasury-auctions/pane.tsx +176 -41
- 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/collection-name.ts +22 -0
- package/src/portfolio/column-values.ts +2 -1
- package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
- package/src/public/remote.ts +7 -1
- package/src/remote/client.ts +191 -11
- package/src/remote/controller-utils.ts +13 -1
- package/src/remote/controller.ts +88 -26
- package/src/remote/endpoint.ts +24 -0
- package/src/remote/form.ts +59 -4
- package/src/remote/resources.ts +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/dom/data-table/frozen-column.ts +3 -1
- package/src/renderers/dom/data-table/index.tsx +27 -9
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +27 -24
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +3 -3
- package/src/renderers/electrobun/bun/desktop/snapshot-commit.ts +77 -0
- package/src/renderers/electrobun/shared/protocol.ts +4 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +3 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +3 -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/sources/gloomberb-cloud/normalizers.ts +9 -5
- package/src/sources/provider-router/cache.ts +3 -1
- package/src/sync/controller.ts +17 -2
- package/src/sync/other-window-tabs.ts +32 -1
- package/src/sync/react.ts +4 -4
- package/src/tickers/renamed-listings.ts +105 -0
- package/src/tickers/search/index.ts +103 -16
- package/src/time-series/bar-spacing.ts +33 -0
- package/src/time-series/base-series.ts +21 -3
- package/src/time-series/chart-bounds.ts +31 -0
- package/src/time-series/field-catalog.ts +17 -0
- package/src/time-series/fundamentals.ts +143 -11
- package/src/time-series/ice-credit.ts +32 -6
- package/src/time-series/resolve.ts +11 -7
- package/src/time-series/session-bar.ts +78 -9
- package/src/time-series/studies/formula.ts +53 -10
- package/src/time-series/studies/pair.ts +18 -7
- package/src/time-series/studies/units.ts +49 -2
- package/src/time-series/types.ts +12 -0
- package/src/types/desktop-window.ts +2 -0
- package/src/types/financials.ts +7 -0
- package/src/types/headless.ts +8 -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/cli-output.ts +6 -3
- package/src/utils/datetime-format.ts +12 -3
- package/src/utils/depositary-receipt.ts +28 -3
- package/src/utils/ebitda.ts +128 -0
- package/src/utils/format.ts +1 -1
- package/src/utils/fundamentals.ts +14 -0
- package/src/utils/max-drawdown.ts +97 -16
- package/src/utils/shell-word.ts +13 -0
- package/src/utils/untrusted-text.ts +29 -0
|
@@ -69,6 +69,12 @@ export interface TabsProps {
|
|
|
69
69
|
paneMenu?: boolean;
|
|
70
70
|
scrollable?: boolean;
|
|
71
71
|
scrollId?: string;
|
|
72
|
+
/**
|
|
73
|
+
* The surface the strip sits on (the status bar's panel, a pane's title
|
|
74
|
+
* bar): the cells the strip draws over its tabs, the edge markers, are
|
|
75
|
+
* painted with it. The app's background by default.
|
|
76
|
+
*/
|
|
77
|
+
background?: string;
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
const WHEEL_DELTA_PER_CELL = 8;
|
|
@@ -93,6 +99,7 @@ function TabsView({
|
|
|
93
99
|
paneMenu = true,
|
|
94
100
|
scrollable = true,
|
|
95
101
|
scrollId,
|
|
102
|
+
background,
|
|
96
103
|
}: TabsProps) {
|
|
97
104
|
// While a chart the user moved into holds the keys, the strip draws as
|
|
98
105
|
// unfocused, so it shows where the arrows went.
|
|
@@ -124,6 +131,7 @@ function TabsView({
|
|
|
124
131
|
activePillFg: colors.selectedText,
|
|
125
132
|
closeFg: colors.textMuted,
|
|
126
133
|
addFg: colors.textMuted,
|
|
134
|
+
bg: background ?? colors.bg,
|
|
127
135
|
};
|
|
128
136
|
const handleSelect = useCallback((value: string) => {
|
|
129
137
|
navigationValueRef.current = value;
|
|
@@ -333,6 +341,7 @@ function OpenTuiTabs({
|
|
|
333
341
|
activePillFg: string;
|
|
334
342
|
closeFg: string;
|
|
335
343
|
addFg: string;
|
|
344
|
+
bg: string;
|
|
336
345
|
};
|
|
337
346
|
}) {
|
|
338
347
|
const [hoveredValue, setHoveredValue] = useState<string | null>(null);
|
|
@@ -409,12 +418,29 @@ function OpenTuiTabs({
|
|
|
409
418
|
// the viewport several times a second. Only a change of the active tab or of
|
|
410
419
|
// the strip geometry is allowed to move it.
|
|
411
420
|
const revealKey = `${activeValue ?? ""}|${tabs.map((tab, index) => `${tab.value}:${tabWidths[index]}`).join(",")}`;
|
|
412
|
-
const revealRef = useRef({ tabWidths, totalWidth, activeIndex: -1 });
|
|
421
|
+
const revealRef = useRef({ tabWidths, totalWidth, activeIndex: -1, dense });
|
|
413
422
|
revealRef.current = {
|
|
414
423
|
tabWidths,
|
|
415
424
|
totalWidth,
|
|
416
425
|
activeIndex: tabs.findIndex((tab) => tab.value === activeValue),
|
|
426
|
+
dense,
|
|
417
427
|
};
|
|
428
|
+
// Which edges of an overflowing strip hide tabs: each shows a marker, so a cut strip says there is more.
|
|
429
|
+
const [edges, setEdges] = useState<{ left: boolean; right: boolean }>({ left: false, right: false });
|
|
430
|
+
// What the markers show, read before setting them: an unchanged strip schedules no render.
|
|
431
|
+
const edgesRef = useRef(edges);
|
|
432
|
+
const updateEdges = useCallback(() => {
|
|
433
|
+
const scrollBox = scrollRef.current;
|
|
434
|
+
const viewportWidth = scrollBox?.viewport?.width || scrollBox?.width || 0;
|
|
435
|
+
const { totalWidth: stripWidth } = revealRef.current;
|
|
436
|
+
const left = scrollBox?.scrollLeft ?? 0;
|
|
437
|
+
const next = viewportWidth > 0
|
|
438
|
+
? { left: left > 0, right: left + viewportWidth < stripWidth }
|
|
439
|
+
: { left: false, right: false };
|
|
440
|
+
if (edgesRef.current.left === next.left && edgesRef.current.right === next.right) return;
|
|
441
|
+
edgesRef.current = next;
|
|
442
|
+
setEdges(next);
|
|
443
|
+
}, []);
|
|
418
444
|
// Blank cells after the last tab, so the strip can start at a tab's edge
|
|
419
445
|
// when it reveals the last ones (see revealActiveTab).
|
|
420
446
|
const [revealPad, setRevealPad] = useState(0);
|
|
@@ -423,7 +449,7 @@ function OpenTuiTabs({
|
|
|
423
449
|
const revealedRef = useRef<{ geometry: string; pendingLeft: number | null }>({ geometry: "", pendingLeft: null });
|
|
424
450
|
const revealActiveTab = useCallback(() => {
|
|
425
451
|
const scrollBox = scrollRef.current;
|
|
426
|
-
const { tabWidths: widths, totalWidth: stripWidth, activeIndex } = revealRef.current;
|
|
452
|
+
const { tabWidths: widths, totalWidth: stripWidth, activeIndex, dense: denseStrip } = revealRef.current;
|
|
427
453
|
const viewportWidth = scrollBox?.viewport?.width || scrollBox?.width || 0;
|
|
428
454
|
if (!scrollBox || activeIndex < 0 || viewportWidth <= 0) return;
|
|
429
455
|
const geometry = `${activeIndex}|${viewportWidth}|${stripWidth}|${widths.join(",")}`;
|
|
@@ -441,8 +467,11 @@ function OpenTuiTabs({
|
|
|
441
467
|
}
|
|
442
468
|
revealedRef.current = { geometry, pendingLeft: null };
|
|
443
469
|
|
|
444
|
-
|
|
445
|
-
|
|
470
|
+
// A dense tab has no blank cell before its label: a strip scrolled to it starts on the blank after the tab before,
|
|
471
|
+
// which the edge marker covers, never on the label's first letter.
|
|
472
|
+
const edge = (start: number) => (denseStrip && start > 0 ? start - 1 : start);
|
|
473
|
+
const activeLeft = edge(widths.slice(0, activeIndex).reduce((sum, width) => sum + width, 0));
|
|
474
|
+
const activeRight = widths.slice(0, activeIndex + 1).reduce((sum, width) => sum + width, 0);
|
|
446
475
|
const currentLeft = scrollBox.scrollLeft ?? 0;
|
|
447
476
|
const currentRight = currentLeft + viewportWidth;
|
|
448
477
|
const scrollToLeft = (left: number) => {
|
|
@@ -455,7 +484,7 @@ function OpenTuiTabs({
|
|
|
455
484
|
setRevealPad(pad);
|
|
456
485
|
};
|
|
457
486
|
// Where each tab starts: a strip scrolled to between two of them shows the end of a label.
|
|
458
|
-
const starts = widths.map((_, index) => widths.slice(0, index).reduce((sum, width) => sum + width, 0));
|
|
487
|
+
const starts = widths.map((_, index) => edge(widths.slice(0, index).reduce((sum, width) => sum + width, 0)));
|
|
459
488
|
const cutAtStart = currentLeft > 0 && !starts.includes(currentLeft);
|
|
460
489
|
|
|
461
490
|
if (stripWidth <= viewportWidth) {
|
|
@@ -475,11 +504,34 @@ function OpenTuiTabs({
|
|
|
475
504
|
if ((scrollBox.scrollLeft ?? 0) !== left) revealedRef.current.pendingLeft = left;
|
|
476
505
|
}
|
|
477
506
|
}, []);
|
|
478
|
-
|
|
507
|
+
const revealAndMark = useCallback(() => {
|
|
508
|
+
revealActiveTab();
|
|
509
|
+
updateEdges();
|
|
510
|
+
}, [revealActiveTab, updateEdges]);
|
|
511
|
+
useEffect(revealAndMark, [revealAndMark, revealKey]);
|
|
479
512
|
// React effects can run before a floating pane's native viewport has its
|
|
480
513
|
// new width. Retry after computed layout, preserving ScrollBox's range update.
|
|
481
|
-
useEffect(() => observeScrollBoxViewportSize(scrollRef.current,
|
|
482
|
-
useEffect(() => observeScrollBoxContentSize(scrollRef.current,
|
|
514
|
+
useEffect(() => observeScrollBoxViewportSize(scrollRef.current, revealAndMark), [revealAndMark, scrollable]);
|
|
515
|
+
useEffect(() => observeScrollBoxContentSize(scrollRef.current, revealAndMark), [revealAndMark, scrollable]);
|
|
516
|
+
|
|
517
|
+
/** Scrolls the strip a viewport's width toward an edge marker that was clicked, starting at a tab's edge. */
|
|
518
|
+
const scrollToward = (direction: -1 | 1) => {
|
|
519
|
+
const scrollBox = scrollRef.current;
|
|
520
|
+
const viewportWidth = scrollBox?.viewport?.width || scrollBox?.width || 0;
|
|
521
|
+
if (!scrollBox || viewportWidth <= 0) return;
|
|
522
|
+
const starts = tabWidths.map((_, index) => tabWidths.slice(0, index).reduce((sum, width) => sum + width, 0))
|
|
523
|
+
.map((start) => (dense && start > 0 ? start - 1 : start));
|
|
524
|
+
const current = scrollBox.scrollLeft ?? 0;
|
|
525
|
+
const maxLeft = Math.max(0, totalWidth + revealPadRef.current - viewportWidth);
|
|
526
|
+
// Right: the first tab cut at the right edge starts the strip. Left: the strip ends where it started.
|
|
527
|
+
const target = direction > 0
|
|
528
|
+
? starts.find((start, index) => start + tabWidths[index]! > current + viewportWidth) ?? maxLeft
|
|
529
|
+
: starts.findLast((start) => start <= Math.max(0, current - viewportWidth)) ?? 0;
|
|
530
|
+
const left = Math.max(0, Math.min(maxLeft, target));
|
|
531
|
+
scrollBox.scrollLeft = left;
|
|
532
|
+
scrollBox.scrollTo({ x: left, y: scrollBox.scrollTop });
|
|
533
|
+
updateEdges();
|
|
534
|
+
};
|
|
483
535
|
|
|
484
536
|
const handleMouseScroll = (event?: {
|
|
485
537
|
preventDefault?: () => void;
|
|
@@ -506,6 +558,7 @@ function OpenTuiTabs({
|
|
|
506
558
|
);
|
|
507
559
|
scrollBox.scrollLeft = nextLeft;
|
|
508
560
|
scrollBox.scrollTo({ x: nextLeft, y: scrollBox.scrollTop });
|
|
561
|
+
updateEdges();
|
|
509
562
|
};
|
|
510
563
|
|
|
511
564
|
const tabRow = (
|
|
@@ -619,18 +672,43 @@ function OpenTuiTabs({
|
|
|
619
672
|
|
|
620
673
|
if (!scrollable) return tabRow;
|
|
621
674
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
675
|
+
// Drawn over the strip's end cells, so showing one never narrows the strip and moves what it reveals,
|
|
676
|
+
// on the surface the strip sits on (`background`), so it reads as the strip's edge and not a tab's cell.
|
|
677
|
+
const edgeMarker = (direction: -1 | 1) => (
|
|
678
|
+
<Box
|
|
679
|
+
position="absolute"
|
|
680
|
+
top={0}
|
|
681
|
+
{...direction < 0 ? { left: 0 } : { right: 0 }}
|
|
682
|
+
width={1}
|
|
627
683
|
height={1}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
684
|
+
zIndex={1}
|
|
685
|
+
backgroundColor={palette.bg}
|
|
686
|
+
onMouseDown={(event: TabPointerEvent) => {
|
|
687
|
+
event.preventDefault();
|
|
688
|
+
event.stopPropagation?.();
|
|
689
|
+
scrollToward(direction);
|
|
690
|
+
}}
|
|
632
691
|
>
|
|
633
|
-
{
|
|
634
|
-
</
|
|
692
|
+
<Text fg={palette.addFg}>{direction < 0 ? "‹" : "›"}</Text>
|
|
693
|
+
</Box>
|
|
694
|
+
);
|
|
695
|
+
|
|
696
|
+
return (
|
|
697
|
+
<Box width="100%" height={1}>
|
|
698
|
+
<ScrollBox
|
|
699
|
+
id={scrollId}
|
|
700
|
+
ref={scrollRef}
|
|
701
|
+
width="100%"
|
|
702
|
+
height={1}
|
|
703
|
+
scrollX
|
|
704
|
+
focusable={false}
|
|
705
|
+
horizontalScrollbarOptions={{ visible: false }}
|
|
706
|
+
onMouseScroll={handleMouseScroll}
|
|
707
|
+
>
|
|
708
|
+
{tabRow}
|
|
709
|
+
</ScrollBox>
|
|
710
|
+
{edges.left ? edgeMarker(-1) : null}
|
|
711
|
+
{edges.right ? edgeMarker(1) : null}
|
|
712
|
+
</Box>
|
|
635
713
|
);
|
|
636
714
|
}
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
removeHistoryIndex,
|
|
10
10
|
resolveTickerForPane,
|
|
11
11
|
setHistoryForIndex,
|
|
12
|
+
settleOpeningPaneHistory,
|
|
12
13
|
syncConfigActiveLayoutState,
|
|
13
14
|
withFocusedPane,
|
|
14
15
|
} from "./layout";
|
|
@@ -43,6 +44,12 @@ export function reduceLayoutAction(state: AppState, action: AppAction): AppState
|
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
|
|
47
|
+
case "SETTLE_OPENING_PANE": {
|
|
48
|
+
const currentIndex = state.config.activeLayoutIndex;
|
|
49
|
+
const entry = settleOpeningPaneHistory(historyForIndex(state.layoutHistory, currentIndex), state.config.layout, action.settlement);
|
|
50
|
+
return { ...state, layoutHistory: setHistoryForIndex(state.layoutHistory, currentIndex, entry) };
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
case "UNDO_LAYOUT": {
|
|
47
54
|
const currentIndex = state.config.activeLayoutIndex;
|
|
48
55
|
const entry = historyForIndex(state.layoutHistory, currentIndex);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { compactFloatingZ, getDockLeafLayouts, getDockedPaneIds, showDockTab } from "../../../layout/pane-manager";
|
|
1
|
+
import { compactFloatingZ, getDockLeafLayouts, getDockedPaneIds, removePane, showDockTab } from "../../../layout/pane-manager";
|
|
2
2
|
import { pinFollowingPane } from "../../../layout/pane-follow";
|
|
3
3
|
import {
|
|
4
4
|
cloneLayout,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import type { DesktopSharedStateSnapshot } from "../../../types/desktop-window";
|
|
19
19
|
import type { BrokerAccount } from "../../../types/trading";
|
|
20
20
|
import { isBrokerPortfolioId } from "../../../utils/broker-instances";
|
|
21
|
-
import type { AppState, LayoutHistoryEntry, PaneRuntimeState } from "./types";
|
|
21
|
+
import type { AppState, LayoutHistoryEntry, OpeningPaneSettlement, PaneRuntimeState } from "./types";
|
|
22
22
|
|
|
23
23
|
function getDefaultCollectionId(config: AppConfig): string {
|
|
24
24
|
return config.portfolios[0]?.id || config.watchlists[0]?.id || "";
|
|
@@ -510,6 +510,44 @@ export function moveHistoryIndex(
|
|
|
510
510
|
return next;
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
+
/**
|
|
514
|
+
* The undo history once a research pane opened ahead of its ticker's lookup
|
|
515
|
+
* settles, `current` being the layout it settled into. One that found its
|
|
516
|
+
* listing has its binding and title in every step that holds it. One whose
|
|
517
|
+
* open came to nothing leaves no step: the history goes back to what it was
|
|
518
|
+
* before the open, redo steps included, or, when steps were taken since, those
|
|
519
|
+
* steps lose it and any that then repeats the step nearer the current layout goes.
|
|
520
|
+
*/
|
|
521
|
+
export function settleOpeningPaneHistory(
|
|
522
|
+
entry: LayoutHistoryEntry,
|
|
523
|
+
current: LayoutConfig,
|
|
524
|
+
{ paneId, symbol, settled, before }: OpeningPaneSettlement,
|
|
525
|
+
): LayoutHistoryEntry {
|
|
526
|
+
if (!settled && before) return before;
|
|
527
|
+
const settle = (layout: LayoutConfig): LayoutConfig => {
|
|
528
|
+
const pane = findPaneInstance(layout, paneId);
|
|
529
|
+
if (pane?.binding?.kind !== "fixed" || pane.binding.symbol !== symbol) return layout;
|
|
530
|
+
return settled
|
|
531
|
+
? { ...layout, instances: layout.instances.map((instance) => instance.instanceId === paneId ? { ...instance, ...settled } : instance) }
|
|
532
|
+
: removePane(layout, paneId);
|
|
533
|
+
};
|
|
534
|
+
const past = entry.past.map(settle);
|
|
535
|
+
const future = entry.future.map(settle);
|
|
536
|
+
if (settled) return { past, future };
|
|
537
|
+
return { past: withoutRepeats(past.reverse(), current).reverse(), future: withoutRepeats(future, current) };
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/** Steps leading away from `current`, less each that repeats the one nearer to it: undoing it would change nothing. */
|
|
541
|
+
function withoutRepeats(steps: LayoutConfig[], current: LayoutConfig): LayoutConfig[] {
|
|
542
|
+
let nearer = JSON.stringify(current);
|
|
543
|
+
return steps.filter((step) => {
|
|
544
|
+
const key = JSON.stringify(step);
|
|
545
|
+
const repeats = key === nearer;
|
|
546
|
+
nearer = key;
|
|
547
|
+
return !repeats;
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
|
|
513
551
|
/** If paneId is a floating pane, bump its zIndex to the top, renumbering a stack that would climb past the shell's overlays. */
|
|
514
552
|
export function bringFloatingToFront(layout: LayoutConfig, paneId: string): LayoutConfig {
|
|
515
553
|
const entryIndex = layout.floating.findIndex((e) => e.instanceId === paneId);
|
|
@@ -538,14 +576,13 @@ export function materializeDetachedLayouts(config: AppConfig): AppConfig {
|
|
|
538
576
|
};
|
|
539
577
|
}
|
|
540
578
|
|
|
541
|
-
export function focusPaneState(state: AppState, paneId: string): AppState {
|
|
579
|
+
export function focusPaneState(state: AppState, paneId: string, trackTicker = true): AppState {
|
|
542
580
|
// A tab of a stack is shown when it takes focus.
|
|
543
581
|
const layout = showDockTab(bringFloatingToFront(state.config.layout, paneId), paneId);
|
|
544
582
|
const config = layout !== state.config.layout ? { ...state.config, layout } : state.config;
|
|
545
|
-
const recentTickers =
|
|
546
|
-
state.recentTickers,
|
|
547
|
-
|
|
548
|
-
);
|
|
583
|
+
const recentTickers = trackTicker
|
|
584
|
+
? nextRecentTickers(state.recentTickers, resolveTickerForPane(state, paneId))
|
|
585
|
+
: state.recentTickers;
|
|
549
586
|
if (
|
|
550
587
|
config === state.config &&
|
|
551
588
|
state.focusedPaneId === paneId &&
|
|
@@ -265,7 +265,7 @@ export function appReducer(state: AppState, action: AppAction): AppState {
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
case "FOCUS_PANE": {
|
|
268
|
-
return focusPaneState(state, action.paneId);
|
|
268
|
+
return focusPaneState(state, action.paneId, action.trackTicker ?? true);
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
case "FOCUS_NEXT": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BrokerAccount } from "../../../types/trading";
|
|
2
|
-
import type { AppConfig, KeybindingsConfig, LayoutConfig, LayoutOrigin, OnboardingProgress, StarPromptConfig } from "../../../types/config";
|
|
2
|
+
import type { AppConfig, KeybindingsConfig, LayoutConfig, LayoutOrigin, OnboardingProgress, PaneInstanceConfig, StarPromptConfig } from "../../../types/config";
|
|
3
3
|
import type { DesktopSharedStateSnapshot } from "../../../types/desktop-window";
|
|
4
4
|
import type { Quote, TickerFinancials } from "../../../types/financials";
|
|
5
5
|
import type { TickerRecord } from "../../../types/ticker";
|
|
@@ -20,6 +20,20 @@ export interface LayoutHistoryEntry {
|
|
|
20
20
|
future: LayoutConfig[];
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/** How a research pane opened ahead of the lookup that finds its ticker settled. */
|
|
24
|
+
export interface OpeningPaneSettlement {
|
|
25
|
+
paneId: string;
|
|
26
|
+
/** The key it was bound to while it loaded. */
|
|
27
|
+
symbol: string;
|
|
28
|
+
/**
|
|
29
|
+
* The binding and title the lookup gave it, or null when its open came to
|
|
30
|
+
* nothing: no listing, a choice of listings, or another pane already on it.
|
|
31
|
+
*/
|
|
32
|
+
settled: Pick<PaneInstanceConfig, "binding" | "title"> | null;
|
|
33
|
+
/** The history before the open, when no step was taken, undone or redone since. */
|
|
34
|
+
before?: LayoutHistoryEntry;
|
|
35
|
+
}
|
|
36
|
+
|
|
23
37
|
type SortDirection = "asc" | "desc";
|
|
24
38
|
|
|
25
39
|
export interface CollectionSortPreference {
|
|
@@ -194,7 +208,13 @@ export type AppAction =
|
|
|
194
208
|
| { type: "MOVE_PANE_TO_NEW_LAYOUT"; paneId: string; name: string; sourceLayoutId: string }
|
|
195
209
|
/** Returns a pane Move to New Layout moved to the layout it came from, which becomes active. */
|
|
196
210
|
| { type: "MOVE_PANE_BACK"; paneId: string }
|
|
197
|
-
|
|
211
|
+
/** `trackTicker: false` keeps the pane's ticker out of the recent tickers: a pane still looking its ticker up. */
|
|
212
|
+
| { type: "FOCUS_PANE"; paneId: string; trackTicker?: boolean }
|
|
213
|
+
/**
|
|
214
|
+
* A research pane opened ahead of the lookup that finds its ticker settles
|
|
215
|
+
* in the active layout's undo history (`settleOpeningPaneHistory`).
|
|
216
|
+
*/
|
|
217
|
+
| { type: "SETTLE_OPENING_PANE"; settlement: OpeningPaneSettlement }
|
|
198
218
|
| { type: "FOCUS_NEXT"; paneOrder: string[] }
|
|
199
219
|
| { type: "FOCUS_PREV"; paneOrder: string[] }
|
|
200
220
|
| { type: "HYDRATE_DESKTOP_SNAPSHOT"; snapshot: DesktopSharedStateSnapshot }
|
package/src/docs/snapshot.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": 1,
|
|
3
3
|
"site": "https://gloom.sh",
|
|
4
|
-
"updatedAt": "2026-11-
|
|
4
|
+
"updatedAt": "2026-11-07",
|
|
5
5
|
"categories": [
|
|
6
6
|
{
|
|
7
7
|
"id": "research",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"code": "DES",
|
|
42
42
|
"name": "Security overview",
|
|
43
43
|
"description": "Quote, chart, and research tabs",
|
|
44
|
-
"detail": "The starting point for any ticker: live quote, day and 52-week range, price chart, fundamentals, and tabs into every other research pane. A bond fund shows its SEC yield, yield to worst and duration beside its distribution yield. T is the same pane; search Ticker Research to open a second one.",
|
|
44
|
+
"detail": "The starting point for any ticker: live quote, day and 52-week range, price chart, fundamentals, and tabs into every other research pane. A bond fund shows its SEC yield, yield to worst and duration beside its distribution yield, and --tax-rate 40.8 adds a muni fund's tax-equivalent yield and muni/Treasury ratio. T is the same pane; search Ticker Research to open a second one.",
|
|
45
45
|
"category": "research",
|
|
46
46
|
"arg": "NVDA",
|
|
47
47
|
"shot": "https://gloom.sh/screenshots/fn/DES.png",
|
|
@@ -430,7 +430,7 @@
|
|
|
430
430
|
"code": "DVD",
|
|
431
431
|
"name": "Dividend yield",
|
|
432
432
|
"description": "Payout history and yield",
|
|
433
|
-
"detail": "Cash distributions, trailing yield, indicated rate when available, and payout growth. A bond fund's distribution yield is labelled as not its SEC yield, which follows it dated with yield to worst and duration; --tax-rate 40.8 adds a muni fund's tax-equivalent yield and muni/Treasury ratio. Several tickers rank in one table. Future payments are not forecast.",
|
|
433
|
+
"detail": "Cash distributions, trailing yield, indicated rate when available, and payout growth. A bond fund's distribution yield is labelled as not its SEC yield, which follows it dated with yield to worst and duration; --tax-rate 40.8 adds a muni fund's tax-equivalent yield and muni/Treasury ratio. Several tickers rank in one table, with those columns too under --tax-rate. Future payments are not forecast.",
|
|
434
434
|
"category": "research",
|
|
435
435
|
"arg": "KO",
|
|
436
436
|
"shot": "https://gloom.sh/screenshots/fn/DVD.png",
|
|
@@ -1202,7 +1202,7 @@
|
|
|
1202
1202
|
"code": "GC",
|
|
1203
1203
|
"name": "Yield curves",
|
|
1204
1204
|
"description": "Government bond curves",
|
|
1205
|
-
"detail": "Government yield curves: US Treasury, TIPS real yields and breakevens, euro AAA, Bund, Gilt, JGB and Canada, with spreads like 2s10s and their one-year percentiles, a two-date difference and a World tab. GC JGB opens a curve directly.",
|
|
1205
|
+
"detail": "Government yield curves: US Treasury, TIPS real yields and breakevens, euro AAA, Bund, Gilt, JGB and Canada, with spreads like 2s10s and their one-year percentiles, a two-date difference and a World tab that adds Mexico's and Brazil's 2- and 10-year yields. GC JGB opens a curve directly.",
|
|
1206
1206
|
"category": "macro",
|
|
1207
1207
|
"shot": "https://gloom.sh/screenshots/fn/GC.png",
|
|
1208
1208
|
"lesson": "/academy/rates-bonds-credit/rates/yield-curve"
|
|
@@ -1388,7 +1388,7 @@
|
|
|
1388
1388
|
"code": "ETF",
|
|
1389
1389
|
"name": "ETF facts and filings",
|
|
1390
1390
|
"description": "A fund's facts and SEC filings",
|
|
1391
|
-
"detail": "A US-listed fund's facts from its sponsor (fee, NAV, premium, net assets, and a bond fund's SEC yield, yield to worst and duration), then its SEC filings: registration statements, prospectus updates, shareholder reports, N-CEN and N-PORT reports. Open any of them inline.",
|
|
1391
|
+
"detail": "A US-listed fund's facts from its sponsor (fee, NAV, premium, net assets, and a bond fund's SEC yield, yield to worst and duration), then its SEC filings: registration statements, prospectus updates, shareholder reports, N-CEN and N-PORT reports. Open any of them inline. --tax-rate 40.8 adds a muni fund's tax-equivalent yield and muni/Treasury ratio.",
|
|
1392
1392
|
"category": "ownership",
|
|
1393
1393
|
"arg": "SPY",
|
|
1394
1394
|
"shot": "https://gloom.sh/screenshots/fn/ETF.png",
|
|
@@ -2547,6 +2547,8 @@
|
|
|
2547
2547
|
"currency",
|
|
2548
2548
|
"TRY",
|
|
2549
2549
|
"cost FX",
|
|
2550
|
+
"real return",
|
|
2551
|
+
"inflation",
|
|
2550
2552
|
"target weights",
|
|
2551
2553
|
"drift",
|
|
2552
2554
|
"rebalance",
|
|
@@ -2565,7 +2567,7 @@
|
|
|
2565
2567
|
"E*TRADE",
|
|
2566
2568
|
"Merrill"
|
|
2567
2569
|
],
|
|
2568
|
-
"updatedAt": "2026-11-
|
|
2570
|
+
"updatedAt": "2026-11-07",
|
|
2569
2571
|
"blocks": [
|
|
2570
2572
|
{
|
|
2571
2573
|
"type": "heading",
|
|
@@ -2591,12 +2593,23 @@
|
|
|
2591
2593
|
},
|
|
2592
2594
|
{
|
|
2593
2595
|
"type": "code",
|
|
2594
|
-
"code": "gloom portfolio create Lira --currency TRY\ngloom portfolio position set Lira THYAO 100 280 # a BIST stock, cost in TRY\ngloom portfolio position set Lira BRK-B 10 20310 TRY # a US stock at what it cost in lira\ngloom portfolio position set Lira BRK-B 10 410 USD --date 2024-03-01 # or in dollars, converted at that day's FX close\ngloom portfolio position set Lira KO 40 62.50 USD --cost-fx 32.15 # or at the rate you paid, TRY per USD\ngloom portfolio show Lira --from 2025-11-06 # P&L since a date, with the currency's move on its own line"
|
|
2596
|
+
"code": "gloom portfolio create Lira --currency TRY\ngloom portfolio position set Lira THYAO 100 280 # a BIST stock, cost in TRY\ngloom portfolio position set Lira BRK-B 10 20310 TRY # a US stock at what it cost in lira\ngloom portfolio position set Lira BRK-B 10 410 USD --date 2024-03-01 # or in dollars, converted at that day's FX close\ngloom portfolio position set Lira KO 40 62.50 USD --cost-fx 32.15 # or at the rate you paid, TRY per USD\ngloom portfolio show Lira --from 2025-11-06 # P&L since a date, with the currency's move on its own line\ngloom portfolio show Lira --from 2025-11-06 --real # and the return after Turkish consumer prices"
|
|
2595
2597
|
},
|
|
2596
2598
|
{
|
|
2597
2599
|
"type": "paragraph",
|
|
2598
2600
|
"text": "A cost in the holding's own currency without `--date` or `--cost-fx` converts at today's rate, and `portfolio show` names the holdings it does that for. Use the date or the rate so P&L carries the currency's move since you bought. A name whose last word is a currency code in capitals (`Baht THB`) creates the portfolio in that currency too."
|
|
2599
2601
|
},
|
|
2602
|
+
{
|
|
2603
|
+
"type": "paragraph",
|
|
2604
|
+
"text": "`--real` deflates the period's total by the consumer prices of the portfolio's currency, from the CPI month before the start's month to the one before the end's (or the latest month published), and names both months:"
|
|
2605
|
+
},
|
|
2606
|
+
{
|
|
2607
|
+
"type": "list",
|
|
2608
|
+
"items": [
|
|
2609
|
+
"**USD**: the ratio of the BLS index at those two months, not seasonally adjusted (FRED's `CPIAUCNS`), as a period's inflation is quoted. A month the BLS did not publish reads the month before it.",
|
|
2610
|
+
"**TRY**: the central bank's table gives TurkStat's changes rather than the index, so the figure is chained from the end month back. Each whole year takes TurkStat's year-on-year change, and each month left over takes its monthly change. Every change is applied as one plus the change, and the factors are multiplied. A twelve-month period is TurkStat's published annual rate: October 2025 to October 2026 reads 29.77%. A month without its change leaves the period without a real return."
|
|
2611
|
+
]
|
|
2612
|
+
},
|
|
2600
2613
|
{
|
|
2601
2614
|
"type": "heading",
|
|
2602
2615
|
"level": 2,
|
|
@@ -5642,7 +5655,7 @@
|
|
|
5642
5655
|
"functions",
|
|
5643
5656
|
"screenshots"
|
|
5644
5657
|
],
|
|
5645
|
-
"updatedAt": "2026-11-
|
|
5658
|
+
"updatedAt": "2026-11-07",
|
|
5646
5659
|
"blocks": [
|
|
5647
5660
|
{
|
|
5648
5661
|
"type": "paragraph",
|
|
@@ -5717,6 +5730,10 @@
|
|
|
5717
5730
|
"`financials`, `fundamentals`, `valuation`, `events`, `analyst` `<symbol>`",
|
|
5718
5731
|
"Revenue and EPS, profile, multiples, dividends and splits, ratings and targets"
|
|
5719
5732
|
],
|
|
5733
|
+
[
|
|
5734
|
+
"`fn CMP <symbols> [--from <date>] [--to <date>] [--total-return] [--currency <code>]`",
|
|
5735
|
+
"Returns side by side, each in its listing's currency: price returns, or with `--total-return` each distribution reinvested at its ex-date close. `--currency USD` converts every close at that day's FX close, so a lira stock's return carries the lira's move"
|
|
5736
|
+
],
|
|
5720
5737
|
[
|
|
5721
5738
|
"`fn DVD <symbols>`",
|
|
5722
5739
|
"Dividend yield and history; several symbols rank in one table by yield, with payout, growth, last ex-date and pay date"
|
|
@@ -5753,7 +5770,7 @@
|
|
|
5753
5770
|
],
|
|
5754
5771
|
[
|
|
5755
5772
|
"`earnings <symbols>`, `fx <currency>`",
|
|
5756
|
-
"Earnings dates; a currency into your base currency"
|
|
5773
|
+
"Earnings dates; a currency into your base currency. Gold, silver, platinum and palladium have no spot quote, so `fx XAU/TRY` is derived from the front-month future (GC=F) and the dollar pair, and says so"
|
|
5757
5774
|
],
|
|
5758
5775
|
[
|
|
5759
5776
|
"`econ [--country all|US|G7|EU|<codes>] [--impact high|medium|low|all] [--search <words>] [--from <date>] [--tz <zone>]`",
|
|
@@ -5783,7 +5800,7 @@
|
|
|
5783
5800
|
"rows": [
|
|
5784
5801
|
[
|
|
5785
5802
|
"`portfolio list|show|create|delete <name>`",
|
|
5786
|
-
"Manual portfolios; `show` lists value, weight, a year of dividend income and its yield, target, drift and the trade to rebalance; `show --explain` adds what those terms mean, `show --drip [--years 1-5] [--withholding <pct>]` projects reinvested dividends, and `show --from <date> [--to <date>]` gives the P&L between two closes with the FX move"
|
|
5803
|
+
"Manual portfolios; `show` lists value, weight, a year of dividend income and its yield, target, drift and the trade to rebalance; `show --explain` adds what those terms mean, `show --drip [--years 1-5] [--withholding <pct>]` projects reinvested dividends, and `show --from <date> [--to <date>]` gives the P&L between two closes with the FX move; `--real` adds the return after the portfolio currency's consumer prices (USD and TRY) and names the CPI months it used"
|
|
5787
5804
|
],
|
|
5788
5805
|
[
|
|
5789
5806
|
"`portfolio create <name> --currency <code>`",
|
|
@@ -5907,7 +5924,7 @@
|
|
|
5907
5924
|
],
|
|
5908
5925
|
[
|
|
5909
5926
|
"`catalog glossary [term]`, `catalog explain <term>`",
|
|
5910
|
-
"What a term means, such as `stop-out`, `B/C`, `drift` or `
|
|
5927
|
+
"What a term means, such as `stop-out`, `B/C`, `drift`, `NAV`, `beta`, `R²` or `VaR`"
|
|
5911
5928
|
],
|
|
5912
5929
|
[
|
|
5913
5930
|
"`fn <function> [argument] [--option value] [--explain]`",
|
|
@@ -6185,7 +6202,7 @@
|
|
|
6185
6202
|
"terminal",
|
|
6186
6203
|
"remote control"
|
|
6187
6204
|
],
|
|
6188
|
-
"updatedAt": "2026-11-
|
|
6205
|
+
"updatedAt": "2026-11-07",
|
|
6189
6206
|
"blocks": [
|
|
6190
6207
|
{
|
|
6191
6208
|
"type": "paragraph",
|
|
@@ -6357,7 +6374,7 @@
|
|
|
6357
6374
|
],
|
|
6358
6375
|
[
|
|
6359
6376
|
"`sec.insider_transactions`",
|
|
6360
|
-
"`ticker`"
|
|
6377
|
+
"`ticker`, `since?`, `until?` (trade dates, `YYYY-MM-DD`: every Form 4 of the window, and which days it covers), `offset?`"
|
|
6361
6378
|
],
|
|
6362
6379
|
[
|
|
6363
6380
|
"`sec.thirteenf_holders`",
|
|
@@ -3,6 +3,7 @@ import { canonicalExchange, parsePublicTickerKey } from "../utils/exchanges";
|
|
|
3
3
|
import { formatNumber } from "../utils/format";
|
|
4
4
|
import { formatUtcDayTime } from "../utils/utc-time";
|
|
5
5
|
import { heldCurrencyUnit } from "../utils/currency-units";
|
|
6
|
+
import { adrRatioText } from "../utils/depositary-receipt";
|
|
6
7
|
import { regularSessionCloseOn } from "./market/freshness";
|
|
7
8
|
import { getRegularSessionDisplay, regularSessionDisplayDate } from "./market/status";
|
|
8
9
|
|
|
@@ -72,12 +73,13 @@ function homeLineRatioText(pair: DepositaryPair): string {
|
|
|
72
73
|
|
|
73
74
|
/**
|
|
74
75
|
* The ratio as a listing's report states it, from its side of the pair:
|
|
75
|
-
* `1 ADR = 10 ordinary shares of GGAL.BA` on the receipt
|
|
76
|
-
* of
|
|
76
|
+
* `1 ADR = 10 ordinary shares of GGAL.BA` on the receipt (`2 preferred
|
|
77
|
+
* shares of PETR4.SA`, homeShareClass), `1 GGAL ADR = 10 of these shares`
|
|
78
|
+
* on a home line.
|
|
77
79
|
*/
|
|
78
80
|
export function depositaryPairText(pair: DepositaryPair, receiptSide: boolean): string {
|
|
79
81
|
if (!receiptSide) return homeLineRatioText(pair);
|
|
80
|
-
return `1 ADR = ${ratioCount(pair.ratio)}
|
|
82
|
+
return `${adrRatioText(pair.ratio, pair.ordinary[0]) ?? `1 ADR = ${ratioCount(pair.ratio)}`} of ${pair.ordinary.join(" / ")}`;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
/** A price as the comparison reads it, with when it was observed. */
|
|
@@ -139,19 +139,23 @@ function previousIndexSession(quote: Quote, date: string): string | null {
|
|
|
139
139
|
* calendar, with the closures in between (an index's, the venue whose days it
|
|
140
140
|
* follows); otherwise for an index from its own sessions; for a currency pair
|
|
141
141
|
* the weekday before; for any other listing the day its own daily closes date
|
|
142
|
-
* its previous close to (`previousCloseDate`, PreviousCloseDates).
|
|
143
|
-
*
|
|
142
|
+
* its previous close to (`previousCloseDate`, PreviousCloseDates). A thin
|
|
143
|
+
* listing's previous trade before the calendar's session is its own day, and
|
|
144
|
+
* one whose closes cannot name it is left undated. Null when nothing dates it.
|
|
144
145
|
*/
|
|
145
146
|
function previousSession(quote: Quote, sessionDate: string): DatedChangeBasis | null {
|
|
147
|
+
if (quote.previousCloseUndated) return null;
|
|
146
148
|
const venue = calendarVenue(quote);
|
|
149
|
+
const dated = quote.previousCloseDate && ISO_DATE.test(quote.previousCloseDate) && quote.previousCloseDate < sessionDate
|
|
150
|
+
? quote.previousCloseDate : null;
|
|
147
151
|
const published = previousPublishedSession(venue, sessionDate);
|
|
152
|
+
// A listing that did not trade in the calendar's session moves from its previous trade, an earlier day.
|
|
153
|
+
if (published && dated && dated < published.date) return { kind: "close", date: dated, venue };
|
|
148
154
|
if (published) return { kind: "close", date: published.date, venue, closed: published.closed };
|
|
149
155
|
const index = previousIndexSession(quote, sessionDate);
|
|
150
156
|
if (index) return { kind: "close", date: index };
|
|
151
157
|
if (isCurrencyPair(quote)) return { kind: "close", date: weekdayBefore(sessionDate) };
|
|
152
|
-
|
|
153
|
-
if (dated && ISO_DATE.test(dated) && dated < sessionDate) return { kind: "close", date: dated };
|
|
154
|
-
return null;
|
|
158
|
+
return dated ? { kind: "close", date: dated } : null;
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
/**
|