Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion tests/console_display_gaps_validation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ try {
id: 'test-tabs', items: [{ id: 'first', label: 'First' }, { id: 'second', label: 'Second' }], active: 'second', onChange() {} });
export const detail = (language, snapshot) => render(language, DayDetail, {
selection: { date: snapshot.date, account: { platform: snapshot.platform, account_alias: snapshot.account_key } },
cell: { phase: 'ready', snapshot } });`, resolveDir: root },
cell: { phase: 'ready', snapshot } });
export const detailState = (language, selection, cell) => render(language, DayDetail, { selection, cell });`, resolveDir: root },
bundle: true, platform: "node", format: "cjs", outfile, jsx: "automatic", loader: { ".css": "empty" },
define: { "import.meta.env": "{}" }, plugins: [{ name: "controlled-read", setup(b) {
b.onLoad({ filter: /\/lib\/hooks\.ts$/ }, () => ({ contents:
Expand Down Expand Up @@ -158,6 +159,14 @@ try {
noCodes(ui.detail(language, snapshot));
assert.ok(!ui.detail(language, snapshot).includes(`>${activity}<`));
}
// A binding rotation withholds a stored day; that is not an unreadable date.
const selection = { date: "2026-10-23", account: { platform: "longbridge", account_alias: "synthetic-paper" } };
const rotated = ui.detailState(language, selection, { phase: "binding-changed" });
noCodes(rotated);
assert.ok(rotated.includes(ui.translate(language, "health.grid.binding_changed_detail")));
assert.ok(!rotated.includes(ui.translate(language, "state.read_failed")), "a rotated binding is not a read failure");
assert.ok(ui.detailState(language, selection, { phase: "error" })
.includes(ui.translate(language, "state.read_failed")), "an unreadable date keeps its own explanation");
const account = { account_alias: "synthetic-paper", platform: "longbridge", status: "ok", unavailable_reason: null,
completeness: "complete", run_count: 1, activity: "filled", runs: [{ activity: "filled", errors_present: false }] };
const summary = { status: "ok", date: "2026-10-16", timezone: "America/New_York", as_of: null,
Expand All @@ -184,6 +193,13 @@ try {
}
const partialFailed = { ...summary, status: "partial", counts: { configured: 10, observed: 1, runs: null }, accounts: [{ ...account, activity: "failed" }] };
assert.ok(statValue(partialFailed).includes(language === "zh" ? "至少 1" : "At least 1"));
// A weekend with nothing scheduled is a non-trading day, not a failed or unknown day.
const weekend = { ...summary, market_session: "weekend", date: "2026-10-31",
counts: { configured: 1, observed: 0, runs: null },
accounts: [{ ...account, status: "no_data", unavailable_reason: "non_trading_weekend",
activity: null, completeness: null, run_count: 0, runs: [] }] };
assert.ok(ui.stats(language, weekend).includes(ui.translate(language, "health.non_trading_day_short")));
assert.match(statValue(weekend), /—/, "a non-trading weekend certifies neither failures nor zero");
}
globalThis.__displayPayload = m0Subjects;
assert.deepEqual(await ui.loadResearchLeads(), ui.parseResearchLeads(m0Subjects));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,11 @@ function RunsKpi({ state }: { state: Api<TodayRunSummary> }) {
: undefined;
// On a weekend, absent records are the schedule, not degraded coverage.
const nonTrading = weekendWithoutScheduledRuns(data);
// The footer badge already names a non-trading day; the sub-line only adds the
// missing-record reason on a normal business day.
const sub = denominatorKnown
? <>{t("overview.business_date", { value: data.date })}
{nonTrading ? <> · {t("overview.non_trading_day_short")}</>
: observed === 0 && <> · {t("overview.no_records_for_day")}</>}</>
{!nonTrading && observed === 0 && <> · {t("overview.no_records_for_day")}</>}</>
: t("state.no_data");
return (
<KpiCard
Expand Down
34 changes: 17 additions & 17 deletions web/strategy-switch-console/v2_asset_map.js

Large diffs are not rendered by default.

Loading