fix(frontend): remove undefined ayanamsa class
Independent Staging Quality Gate / validate (push) Successful in 16m5s
Independent Staging Quality Gate / publish (push) Successful in 2m7s

This commit is contained in:
Jesse_Chen
2026-09-03 22:34:51 +08:00
parent 734d20590c
commit 027e4b0827
2 changed files with 17 additions and 1 deletions
+16
View File
@@ -7888,3 +7888,19 @@
- 相关记录:无
- 复发自:无
- 修复版本:待发布
## BUG-512 | 岁差设置组件携带无样式类名导致前端发布门失败
- 状态:resolved
- 首次发现:2026-09-03
- 最近更新:2026-09-03
- 影响面:`frontend/src/components/ayanamsa-preference-field.tsx``frontend/tests/class-name-definition-contract.test.ts`
- 用户现象:staging quality gate 的前端测试 `2609 pass / 1 fail`,唯一失败为 `ayanamsa-preference (src/components/ayanamsa-preference-field.tsx)`
- 触发条件:通用类名契约扫描岁差设置组件。
- 根因:外层 `<section>` 同时使用已有样式类 `sheet-section` 和没有 CSS、没有行为用途的冗余类 `ayanamsa-preference`
- 修复:删除冗余 `ayanamsa-preference`,保留承担实际样式的 `sheet-section`;不新增空 CSS,也不扩大 allowlist。
- 验证:`cd frontend && npx tsx --test tests/class-name-definition-contract.test.ts`
- 防复发:组件新增项目类名必须有真实 CSS 或明确的无样式行为用途;纯冗余 modifier 直接删除。
- 相关记录:BUG-511
- 复发自:无
- 修复版本:待发布
@@ -16,7 +16,7 @@ export function AyanamsaPreferenceField({
readonly onChange: (next: AyanamsaName) => void;
}) {
return (
<section className="sheet-section ayanamsa-preference" aria-labelledby="ayanamsa-preference-title">
<section className="sheet-section" aria-labelledby="ayanamsa-preference-title">
<div className="section-heading">
<b id="ayanamsa-preference-title"></b>
<small></small>