+ );
+}
+
/**
* The ascendant is a chart point: nakshatra, lord and pada come from the
- * engine (BUG-1201); it has no dignity, so the status cell says 不适用.
- * `house` is 1 except on the Moon chart, which counts from the Moon.
+ * engine (BUG-1201). It is not a planet, so the status cell is "/" and
+ * ASCENDANT_STATUS_HELP. `house` is 1 except on the Moon chart, which counts
+ * from the Moon.
*/
function AscendantRow({ row, house = row.house }: { row: ChartViewAscendantRow; house?: number }) {
return (
@@ -96,7 +115,7 @@ function AscendantRow({ row, house = row.house }: { row: ChartViewAscendantRow;
{row.nakshatraLord ? : "—"}
+
);
}
diff --git a/frontend/tests/chart-moon-transit.test.tsx b/frontend/tests/chart-moon-transit.test.tsx
index 283b9014..2bac63f6 100644
--- a/frontend/tests/chart-moon-transit.test.tsx
+++ b/frontend/tests/chart-moon-transit.test.tsx
@@ -92,7 +92,11 @@ test("the Moon chart is the D1 counted from the Moon's sign, projected without a
assert.match(ascendantRow, /
Uttara Phalguni<\/td>/);
assert.match(ascendantRow, /is-sun/);
assert.match(ascendantRow, />1);
- assert.match(ascendantRow, />不适用);
+ // 原值:/>不适用
+ // 新值:chart-page-asc-status 与说明句
+ // 原因:issue #87。月亮盘与本命共用上升行,状态格改「/」。
+ assert.match(ascendantRow, /chart-page-asc-status/);
+ assert.match(ascendantRow, /data-chart-help="上升点是命盘的起点,不是行星,不判断入旺或落陷"/);
});
test("a chart counted from the ascendant still draws the lagna mark in house 1 only", async () => {
diff --git a/frontend/tests/chart-page-hook.test.ts b/frontend/tests/chart-page-hook.test.ts
index 2f967c90..803a6ca5 100644
--- a/frontend/tests/chart-page-hook.test.ts
+++ b/frontend/tests/chart-page-hook.test.ts
@@ -186,7 +186,10 @@ test("old capability-less module cache stays hidden through direct reads and lay
const d9 = view.vedic.vargas.find((item) => item.id === "D9")!;
assert.equal(d9.supportsDignity, undefined);
assert.equal(d9.supportsVargottama, undefined);
- assert.doesNotMatch(renderToStaticMarkup(React.createElement(VargaTable, { varga: d9 })), />庙旺<|>同位<|>不适用);
+ // 原值:/>庙旺<|>同位<|>不适用
+ // 新值:/>庙旺<|>同位<|chart-page-asc-status/
+ // 原因:issue #87。上升状态格不再写「不适用」。旧缓存整列仍须隐藏,保护改认这个 class。
+ assert.doesNotMatch(renderToStaticMarkup(React.createElement(VargaTable, { varga: d9 })), />庙旺<|>同位<|chart-page-asc-status/);
assert.doesNotMatch(renderToStaticMarkup(React.createElement(ChartParamTable, { view })), /引擎|Swiss Ephemeris/);
};
await h.render(null);
diff --git a/frontend/tests/chart-varga-table.test.tsx b/frontend/tests/chart-varga-table.test.tsx
index cefabcf5..48d07b01 100644
--- a/frontend/tests/chart-varga-table.test.tsx
+++ b/frontend/tests/chart-varga-table.test.tsx
@@ -99,11 +99,12 @@ test("the D1 table is byte-for-byte the table the page drew before BUG-1076, asc
// (Leo 29°23′ = Uttara Phalguni pada 1, lord Sun), where the baseline had dashes.
const baseline = readFileSync(new URL("./fixtures/chart-d1-table-baseline.html", import.meta.url), "utf8");
const dashes = '
';
assert.equal(baseline.split(dashes).length, 2, "the baseline's ascendant row is the only all-dash row");
assert.equal(table, baseline.replace(dashes, filled));
});
@@ -117,7 +118,12 @@ test("the D1 ascendant row shows the engine's nakshatra, lord and pada", async (
assert.match(ascendant, /
Uttara Phalguni<\/td>/);
assert.match(ascendant, /is-sun/, "Uttara Phalguni's lord is the Sun");
assert.match(ascendant, />1, "pada 1");
- assert.match(ascendant, />不适用);
+ // 原值:/>不适用
+ // 新值:chart-page-asc-status 与说明句
+ // 原因:issue #87。状态格改「/」,读屏与悬停读同一句,不再写「不适用」。
+ assert.match(ascendant, /chart-page-asc-status/);
+ assert.match(ascendant, /data-chart-help="上升点是命盘的起点,不是行星,不判断入旺或落陷"/);
+ assert.match(ascendant, /aria-hidden="true">\/);
// An older cached chart without the fields still renders, with dashes.
const chart = structuredClone(golden.chart);
for (const key of ["nakshatra", "nakshatra_pada", "nakshatra_lord"]) delete (chart.ascendant as Record)[key];
@@ -155,7 +161,11 @@ test("divisional rows carry engine dignity and vargottama, and drop nakshatra co
assert.match(row(markup, "火星"), />中性\(Neutral\));
assert.match(row(markup, "水星"), />入敌\(Enemy Sign\));
assert.match(row(markup, "木星"), />极敌\(Great Enemy\));
- assert.match(row(markup, "上升"), />不适用, "the ascendant has no sign dignity");
+ // 原值:/>不适用
+ // 新值:chart-page-asc-status 与说明句
+ // 原因:issue #87。分盘上升的庙旺格改「/」,并带同一句说明。
+ assert.match(row(markup, "上升"), /chart-page-asc-status/, "the ascendant has no sign dignity");
+ assert.match(row(markup, "上升"), /data-chart-help="上升点是命盘的起点,不是行星,不判断入旺或落陷"/);
// Every divisional chart the engine returned has its own rows, D1 has none.
for (const varga of view.vedic.vargas) {
if (varga.id === "D1") assert.equal(varga.rows, undefined);
@@ -230,7 +240,10 @@ test("valid false and null results never turn supported columns off", async () =
const markup = tableMarkup(chartViewVargaSchema.parse(copy));
assertColumns(markup, true, true);
assert.doesNotMatch(markup.match(/([\s\S]*?)<\/tbody>/)?.[1] ?? "", />同位<|\((?:Exalted|Own Sign|Debilitated|Neutral)\));
- assert.match(row(markup, "上升"), />不适用);
+ // 原值:/>不适用
+ // 新值:chart-page-asc-status
+ // 原因:issue #87。支持庙旺列时上升格仍在,内容改成「/」。
+ assert.match(row(markup, "上升"), /chart-page-asc-status/);
});
test("capability schema rejects wrong types and direct cache rendering requires strict true", async () => {
diff --git a/scripts/pl9_reader_export.py b/scripts/pl9_reader_export.py
index 2f5eb1a1..c2576d16 100644
--- a/scripts/pl9_reader_export.py
+++ b/scripts/pl9_reader_export.py
@@ -1049,10 +1049,9 @@ def render_pl9_parity_markdown(packet: dict) -> str:
if ascendant:
info = _ascendant_report_fields(ascendant)
asc_label = 'Ascendant' if _lang == 'en' else '上升'
- dignity = 'not applicable' if _lang == 'en' else '不适用'
lines.append(
f"| {_cell(asc_label)} | {_cell(_token(info['sign_lord']))} | {_cell(_token(info['nakshatra_lord']))} | "
- f"- | - | {_cell(dignity)} | - |"
+ f"- | - | {_cell('/')} | - |"
)
for planet in ('Sun', 'Moon', 'Mars', 'Mercury', 'Jupiter', 'Venus', 'Saturn', 'Rahu', 'Ketu'):
row = _dict(planets.get(planet))
@@ -1065,6 +1064,17 @@ def render_pl9_parity_markdown(packet: dict) -> str:
)
lines.extend([
'',
+ *(
+ [
+ (
+ 'The ascendant is the starting point of the chart, not a planet, so it has no dignity.'
+ if _lang == 'en'
+ else '上升点是命盘的起点,不是行星,不判断入旺或落陷'
+ ),
+ '',
+ ]
+ if ascendant else []
+ ),
(
'Sign lord, star lord, sub lord and sub-sub lord name the ruler of the planet sign, nakshatra and KP subdivision. Strength ratio compares Shadbala with the required strength. A ratio of 1 or more meets it.'
if _lang == 'en'
diff --git a/tests/test_report_chart_blank_columns.py b/tests/test_report_chart_blank_columns.py
index 13199233..797e6f5f 100644
--- a/tests/test_report_chart_blank_columns.py
+++ b/tests/test_report_chart_blank_columns.py
@@ -189,6 +189,22 @@ def test_full_data_chart_section_draws_each_ready_chart_once(editions) -> None:
assert "##### Navamsha" not in section and "##### p7 · Navamsha" not in section
+def _paragraph_after_heading_table(markdown: str, heading: str) -> str:
+ """The first non-empty line after the heading's table."""
+ lines = markdown.splitlines()
+ start = next(i for i, line in enumerate(lines) if line.startswith("#") and heading in line)
+ seen_row = False
+ for line in lines[start + 1:]:
+ if line.startswith("|"):
+ seen_row = True
+ continue
+ if seen_row and line.strip():
+ return line.strip()
+ if line.startswith("#"):
+ break
+ raise AssertionError(f"no paragraph after {heading}")
+
+
def _heading_table(markdown: str, heading: str) -> list[list[str]]:
"""Like _table_after, but the lord table is a #### heading, not ###."""
lines = markdown.splitlines()
@@ -219,8 +235,20 @@ def test_birth_position_table_starts_with_the_ascendant(editions) -> None:
assert zh_rows[1][5] == "1"
lords = _heading_table(zh, "行星主星与状态")
assert lords[1][0] == "上升"
- assert lords[1][5] == "不适用"
+ # 原值:lords[1][5] == "不适用"
+ # 新值:"/"
+ # 原因:issue #87。上升不是行星,状态格写「/」,说明放到表下。
+ assert lords[1][5] == "/"
assert lords[1][2] in {fields["nakshatra_lord"], lord_zh.get(fields["nakshatra_lord"])}
+ assert _paragraph_after_heading_table(zh, "行星主星与状态") == (
+ "上升点是命盘的起点,不是行星,不判断入旺或落陷"
+ )
+ en_lords = _heading_table(en, "Planet Lords and Dignity")
+ assert en_lords[1][0] in {"Ascendant", "Lagna", "上升"}
+ assert en_lords[1][5] == "/"
+ assert _paragraph_after_heading_table(en, "Planet Lords and Dignity") == (
+ "The ascendant is the starting point of the chart, not a planet, so it has no dignity."
+ )
en_rows = _heading_table(en, "Planetary Raw Positions")
assert en_rows[1][0] in {"Ascendant", "Lagna", "上升"}
assert fields["nakshatra"] in en_rows[1][6]