Files
Jyotisha/frontend/src/components/consult-chart-data.tsx
T
ClaudeandClaude Fable 5.2 3fbab50bb3
Independent Staging Quality Gate / validate-python (push) Successful in 10m51s
Independent Staging Quality Gate / validate-frontend (push) Successful in 12m31s
Independent Staging Quality Gate / publish (push) Successful in 3m51s
feat: page-built 盘面数据 under consult answers; repair a missing 判断依据 section
The receipt carries a small chart record copied from the evidence card
(natal positions with D9 signs, running Vimshottari and Narayana periods,
slow transits with the next sign change); the page renders it as a folded
set of tables. A first answer that reads the chart but stops without its
判断依据 section gets one continuation that writes only that section.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2Vp62Ur3C7yRWQdSq
2026-11-16 01:13:21 +08:00

95 lines
4.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client";
import { ChevronRight } from "lucide-react";
import { planetZh, signZh } from "@/lib/chart-view-labels";
import {
CONSULT_CHART_DATA_TITLE,
CONSULT_CHART_PERIOD_LEVEL,
CONSULT_CHART_PERIOD_SYSTEM,
consultChartParameterLine,
type ConsultChartData,
} from "@/lib/consult-chart-data";
const bodyZh = (name: string) => (name === "Ascendant" ? "上升" : planetZh(name));
const degreeText = (value: number | undefined) => (value === undefined ? "" : `${value.toFixed(2)}°`);
const span = (start?: string, end?: string) => (start && end ? `${start} 至 ${end}` : "");
/**
* 「盘面数据」 under an answer (owner 2026-11-16): natal positions, the running
* periods and the slow transits, built by the page from the receipt. Same
* hairline disclosure as 「解读依据」; tables keep one line per row and scroll
* sideways on a narrow screen.
*/
export function ConsultChartDataFold({ data }: { readonly data: ConsultChartData }) {
return (
<section className="personal-report-fact-tables consult-answer-basis consult-chart-data" aria-label={CONSULT_CHART_DATA_TITLE}>
<details>
<summary>
<span className="personal-report-fact-title">{CONSULT_CHART_DATA_TITLE}</span>
<ChevronRight aria-hidden="true" className="personal-report-fact-chevron" />
</summary>
<div className="consult-chart-data-body">
<p className="consult-chart-data-note">本命盘({consultChartParameterLine(data)})</p>
<div className="consult-chart-data-scroll">
<table>
<thead><tr><th>星</th><th>星座</th><th>宫</th><th>度数</th><th>D9</th></tr></thead>
<tbody>
{data.natal.map((row) => (
<tr key={row.body}>
<td>{bodyZh(row.body)}{row.retrograde ? "(逆行)" : ""}</td>
<td>{signZh(row.sign)}</td>
<td>{row.house ?? ""}</td>
<td>{degreeText(row.degree)}</td>
<td>{row.d9 ? signZh(row.d9) : ""}</td>
</tr>
))}
</tbody>
</table>
</div>
{data.periods.length ? (
<>
<p className="consult-chart-data-note">现在的运程</p>
<div className="consult-chart-data-scroll">
<table>
<thead><tr><th>体系</th><th>层级</th><th>主星或星座</th><th>起止</th></tr></thead>
<tbody>
{data.periods.map((row) => (
<tr key={`${row.system}-${row.level}`}>
<td>{CONSULT_CHART_PERIOD_SYSTEM[row.system]}</td>
<td>{CONSULT_CHART_PERIOD_LEVEL[row.level]}</td>
<td>{row.system === "narayana" ? signZh(row.lord) : planetZh(row.lord)}</td>
<td>{span(row.start, row.end)}</td>
</tr>
))}
</tbody>
</table>
</div>
</>
) : null}
{data.transits.length ? (
<>
<p className="consult-chart-data-note">慢星行运{data.parameters?.referenceDate ? `(${data.parameters.referenceDate})` : ""}</p>
<div className="consult-chart-data-scroll">
<table>
<thead><tr><th>星</th><th>现在</th><th>宫</th><th>下一次换座</th></tr></thead>
<tbody>
{data.transits.map((row) => (
<tr key={row.body}>
<td>{planetZh(row.body)}{row.retrograde ? "(逆行)" : ""}</td>
<td>{signZh(row.sign)} {degreeText(row.degree)}</td>
<td>{row.house ?? ""}</td>
<td>{row.nextDate && row.nextSign ? `${row.nextDate} 进${signZh(row.nextSign)}` : ""}</td>
</tr>
))}
</tbody>
</table>
</div>
</>
) : null}
</div>
</details>
</section>
);
}