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:
co-authored by
Grok (agent loop)
parent
05f8800531
commit
a295afa40f
+1
-1
@@ -1183,7 +1183,7 @@ D40 / D45 / D60 的表格上方,出生时间不是「已校正」时多一句
|
||||
| 盘型 | 列 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| 本命 | 上面八列 | 不变(与基线渲染逐字节相同) |
|
||||
| D2–D60 | 行星 · 分盘星座(度°分′)· 宫位 · 本命星座 · 庙旺;仅 D9 再有同位 | 宫位从该分盘上升数;庙旺是引擎给的十档(入旺 / 本垣 / 入庙 / 极友 / 入友 / 中性 / 入敌 / 极敌 / 落陷 / 落陷取消),措辞与本命「状态」列一字不差(2026-10-03,BUG-1202,取代原先「入旺 / 自宫 / 落陷,其余—」的三档);旧缓存没有引擎等级时整列不显示,页面不自算;上升此格「不适用」。2026-09-29 收口:仅 D9 的 D1↔D9 同座比较显示为同位,其他分盘不显示此列。两列各由服务端能力声明控制,缺声明保守隐藏,不以是否命中推断支持性。**没有星宿 / 宿主 / 足**:那是本命经度的属性。逆行在行星格后标「逆」(分盘不改顺逆)。首行是分盘上升 |
|
||||
| D2–D60 | 行星 · 分盘星座(度°分′)· 宫位 · 本命星座 · 庙旺;仅 D9 再有同位 | 宫位从该分盘上升数;庙旺是引擎给的十档(入旺 / 本垣 / 入庙 / 极友 / 入友 / 中性 / 入敌 / 极敌 / 落陷 / 落陷取消),措辞与本命「状态」列一字不差(2026-10-03,BUG-1202,取代原先「入旺 / 自宫 / 落陷,其余—」的三档);旧缓存没有引擎等级时整列不显示,页面不自算;上升此格「不适用」。2026-09-29 收口:仅 D9 的 D1↔D9 同座比较显示此列,其他分盘不显示。2026-10-13:同座写「是」,不同座写「否」,表头仍是「同位」(不再用横杠,避免看成没算)。两列各由服务端能力声明控制,缺声明保守隐藏,不以是否命中推断支持性。**没有星宿 / 宿主 / 足**:那是本命经度的属性。逆行在行星格后标「逆」(分盘不改顺逆)。首行是分盘上升 |
|
||||
| 月亮盘 | 本命八列 | 宫位从月亮所在星座数;表头「月亮盘 · 以月亮所在星座(X)为第 1 宫」;盘上「As」画在本命上升落的那一宫(`VedicChartSvg` 的 `ascendantHouse`,其它盘默认 1 宫不变) |
|
||||
| Bhava | 行星 · 黄道经度 · 星座宫 · Bhava 宫 · 换宫;另一张「宫 · 宫头 · 起点(sandhi)」12 行 | Sripati。换宫的行用 `--color-selected` 浅底。拿不到真实 MC 时这一栏走失败句,不画等宫(BUG-1077) |
|
||||
| 行运 | 行星 · 今天的位置 · 速度 · 落本命 · 本命同星 | 表头写计算时刻「行运 · YYYY-MM-DD 12:00(时区)」,上方一句「以本命上升为第 1 宫,放的是这一天中午的行星位置。岁差和交点与本命相同。」 |
|
||||
|
||||
@@ -152,7 +152,7 @@ function VargaRow({ row, supportsDignity, supportsVargottama }: { row: ChartView
|
||||
<td>{row.house}宫</td>
|
||||
<td>{row.natalSignLabel}</td>
|
||||
{supportsDignity && <td className="chart-page-planet-mid">{row.dignity ? VARGA_DIGNITY_LABEL[row.dignity] : "—"}</td>}
|
||||
{supportsVargottama && <td className="chart-page-planet-mid">{row.vargottama ? "同位" : "—"}</td>}
|
||||
{supportsVargottama && <td className="chart-page-planet-mid">{row.vargottama ? "是" : "否"}</td>}
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
@@ -167,7 +167,7 @@ function VargaAscendantRow({ row, supportsDignity, supportsVargottama }: { row:
|
||||
<td>1宫</td>
|
||||
<td>{row.natalSignLabel}</td>
|
||||
{supportsDignity && <td className="chart-page-planet-mid">不适用</td>}
|
||||
{supportsVargottama && <td className="chart-page-planet-mid">{row.vargottama ? "同位" : "—"}</td>}
|
||||
{supportsVargottama && <td className="chart-page-planet-mid">{row.vargottama ? "是" : "否"}</td>}
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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)];
|
||||
|
||||
Reference in New Issue
Block a user