feat: localize quality report

This commit is contained in:
Codex
2026-06-21 23:43:02 +08:00
parent a457a4acf3
commit 936084465d
3 changed files with 78 additions and 35 deletions
+24 -2
View File
@@ -12,6 +12,24 @@ const statusLabels = {
fail: "失败",
} as const;
const ruleLabels: Record<string, string> = {
industry_alignment: "行业一致性",
image_text_match: "图文匹配",
voice_consistency: "表达视角一致性",
platform_fit: "平台适配",
company_name_integrity: "公司名称完整性",
title_quality: "标题质量",
body_quality: "正文质量",
hallucination_risk: "事实幻觉风险",
claim_consistency: "主张一致性",
context_sensitive_terms: "语境敏感词",
};
const targetAgentLabels: Record<string, string> = {
title: "标题改写",
body: "正文改写",
};
export function QaReportPanel({ report }: QaReportPanelProps) {
if (!report) {
return (
@@ -33,7 +51,7 @@ export function QaReportPanel({ report }: QaReportPanelProps) {
{report.checks.map((check) => (
<div className="qa-item" key={check.rule_id}>
<div className="qa-title-row">
<strong>{check.rule_id.replace(/_/g, " ")}</strong>
<strong>{ruleLabels[check.rule_id] ?? check.rule_id}</strong>
<span className={`status-pill ${check.status}`}>
{statusLabels[check.status]}
</span>
@@ -41,7 +59,11 @@ export function QaReportPanel({ report }: QaReportPanelProps) {
<p>{check.reason}</p>
<small>{check.evidence}</small>
{check.suggested_fix && <em>{check.suggested_fix}</em>}
{check.target_agent && <code>{check.target_agent}</code>}
{check.target_agent && (
<code>
{targetAgentLabels[check.target_agent] ?? check.target_agent}
</code>
)}
</div>
))}
</div>