fix(report): draw charts in the full-data body and clean Chinese residue

New reports draw one north-Indian chart for each ready divisional in the body, so the trailing duplicate section drops. Chinese full-data prose no longer glues English onto Han or leaves listed, background, or native. The birth table starts with the ascendant. The D9 same-sign column says yes or no.

Self-test: tsc exit 0; npm run lint exit 0 (0 errors, 125 existing warnings); three frontend test files 39 pass, 0 fail, 0 cancelled; pytest test_report_chart_blank_columns.py 16 passed; seven related report files 88 passed, exit 0; privacy markers 63 passed.

Co-Authored-By: Grok (agent loop)
This commit is contained in:
jesse-ux
2026-10-13 14:02:26 +08:00
co-authored by Grok (agent loop)
parent 05f8800531
commit a295afa40f
14 changed files with 3466 additions and 10 deletions
+16 -1
View File
@@ -138,7 +138,11 @@ test("divisional rows carry engine dignity and vargottama, and drop nakshatra co
for (const column of ["行星", "分盘星座", "宫位", "本命星座", "庙旺", "同位"]) assert.match(header, new RegExp(`>${column}<`));
assert.doesNotMatch(header, /星宿|宿主|pada/);
// Same wording as the D1 status column (BUG-1202), friendship levels included.
assert.match(row(markup, "土星"), />入庙\(Own Sign\)<[\s\S]*>同位</);
// 原值:同位行星单元格是「同位」,非同位是「—」
// 新值:同位写「是」,非同位写「否」
// 原因:BUG-1315。横杠和「没数据」长得一样,表头仍叫「同位」
assert.match(row(markup, "土星"), />入庙\(Own Sign\)<[\s\S]*>是</);
assert.match(row(markup, "太阳"), />否</);
assert.match(row(markup, "太阳"), />落陷\(Debilitated\)</);
assert.match(row(markup, "月亮"), />入友\(Friendly Sign\)</);
assert.match(row(markup, "火星"), />中性\(Neutral\)</);
@@ -168,6 +172,17 @@ function assertColumns(markup: string, dignity: boolean, vargottama: boolean) {
for (const [, cells] of rows) assert.equal((cells!.match(/<(?:th|td)\b/g) ?? []).length, count);
}
test("a non-vargottama row says 否 and a non-D9 chart has no same-sign column", async () => {
const view = await vargaView();
const d9 = render(view, "D9");
assert.match(row(d9, "太阳"), />否</);
const d10 = view.vedic.vargas.find((item) => item.id === "D10")!;
assert.equal(d10.supportsVargottama, false);
const markup = tableMarkup(d10);
assert.doesNotMatch(markup, />同位</);
assert.doesNotMatch(markup, />否</);
});
test("server capabilities retain dignity for every Dn and vargottama only for D9", async () => {
const view = await vargaView();
for (const varga of view.vedic.vargas) {
File diff suppressed because one or more lines are too long
@@ -36,6 +36,19 @@ test("an older body without chart fences keeps its charts, without the moved cav
assert.doesNotMatch(markup, /出生时间敏感/);
});
test("a full-data body that fences every calculation chart drops the trailing section", () => {
const fullData = JSON.parse(readFileSync(new URL("./fixtures/report-full-data-chart-fences.json", import.meta.url), "utf8"));
const fullCharts = assembleLongformCharts(fullData.packet, "ev-cover-longform");
const drawn = fencedReportChartIds(fullData.markdown);
assert.ok(fullCharts.length > 0);
for (const chart of fullCharts) assert.ok(drawn.has(chart.id), chart.id);
assert.equal(renderToStaticMarkup(React.createElement(ReportCalculationCharts, {
charts: fullCharts,
markdown: fullData.markdown,
language: "zh",
})), "");
});
test("the page and the export skip the same charts", () => {
const first = /```jyotish-chart\n[\s\S]*?```/.exec(fixture.markdown)![0];
const drawn = [...fencedReportChartIds(first)];