feat(settings,reports): six ayanamsa options; report-scope solid button colours (T6/T7, BUG-1078)

T6: offer True Citra and Fagan-Bradley beside Raman/Lahiri/KP/True Pushya,
engine-supported values only; widen profiles_ayanamsa_check by an additive
migration; ephemeris note names; path tests so no new value falls back to
Raman.

T7: the unlayered `button { color: inherit; }` beats Tailwind's
text-primary-foreground, so solid report buttons showed page ink (light
(light 4.85:1, dark 5.77:1), grey disabled without fade, neutral selected
preset. button.tsx and theme tokens unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
Jesse_Chen
2026-09-28 15:54:53 +08:00
co-authored by Claude Opus 5.5
parent 856dab6c55
commit 873fac8a5b
15 changed files with 483 additions and 8 deletions
+14
View File
@@ -14497,3 +14497,17 @@
- 相关记录:BUG-320(Bhava 进换升表);`TASK-chart-types-and-report-buttons-20260928` T5。
- 复发自:无
- 修复版本:本地 `c35e0195`(未推送)。
## BUG-1078 | 我的报告:实心按钮标签继承正文色(浅色黑字深红底、深色浅字浅珊瑚底),禁用态半透明
- 状态:investigating(修复已在本地分支 `codex/ayanamsa-report-buttons-20260928` 提交,未推送、未部署;真机未走)
- 首次发现 / 最近更新:2026-09-28 / 2026-09-28
- 影响面:「我的报告」列表(`.report-center-*`)、阅读页与分块导出对话框(`.personal-report-reader`、`.report-export-*`)、报告 loading / 状态 / error / not-found(`.personal-report-state`)上渲染为 `<button>` 的实心 `Button`(「导出选中」「继续等待」等)与所有禁用按钮。**同样的根因作用于全站所有渲染为 `<button>` 的实心 `Button`**,本单按产品决定只修报告范围,其它页面未修(见防复发)。
- 现象:产品转述真机反馈:导出按钮黑字配深红色背景,看着不舒服。
- 触发条件:浅色主题打开分块导出,「导出选中」是近黑字 #1d1d1f 在 #a9583e 上(3.33:1);深色主题是 #f2f0ea 在 #d78064 上(2.57:1)。未勾选时按钮再被整体淡到 45%。套餐选中态用 `--color-action-soft`,深色下是 #3a2620 深红褐。
- 根因:`globals.css` 顶部未分层的 `button { color: inherit; }` 与 `button:disabled { opacity: .45; }` 压过 Tailwind v4 放在 `@layer utilities` 里的 `text-primary-foreground` 与 `disabled:opacity-50`(未分层声明总是赢分层声明,与选择器权重无关)。所以 `variant="default"` 的 `<button>` 标签颜色一直是继承的正文色,而不是设计的 `--color-on-dark`。`<Button render={<Link/>}>` 渲染为 `<a>`,不受影响,所以「去登录」这类链接按钮一直是对的。实证:本地 `next build` 产出的 CSS + 无头 Chrome 取 `getComputedStyle`,基线「导出选中 (3)」浅色 `color: rgb(29, 29, 31)`、深色 `rgb(242, 240, 234)`(样张与数值见 PROGRESS)。任务书起初判断为「深色主题下近黑字」,按实测更正。
- 修复(产品 2026-09-28 拍板:只改我的报告,不改全站):`globals.css` 新增一段只挂在四个报告根类下的按钮规则,实心按钮(`[data-slot="button"][class~="bg-primary"]`)自己声明底色与标签色:浅色 #fbfaf7 on #a9583e(4.85:1,hover 同原 `bg-primary/80`);深色 `--color-ink` #f2f0ea on `--color-action-on-dark` #8f4a33(5.77:1),hover 混 6% ink(5.1:1)。禁用态(任何变体)= `--color-canvas-strong` 底 + `--color-ink-tertiary` 字、`opacity: 1`。套餐选中态改 `--color-canvas-muted` 底 + `--color-ink` 字 + `--color-ink-secondary` 边。`button.tsx`、全局 `button` 规则与全部主题 token 未改。
- 验证:`frontend/tests/report-buttons-scope-20260928.test.ts`(5 条):`button.tsx` 变体 / 禁用淡出 / `data-slot` 原样;三处主题块相关 token 原值;所有 `[data-slot="button"]` 覆盖规则都以报告作用域开头、两条深色路径各一处、样式表不定义 `.bg-primary`;前后对比度(前 < 4.5、后 ≥ 4.5)且覆盖规则自己设 `color`;套餐选中态不再用 action-soft。`class-name-definition-contract`、`dark-theme-contract`、`design-token-contract`、`report-export-drawer` 仍绿。无头 Chrome 计算样式:新版浅色「导出选中 (3)」`rgb(251, 250, 247)` on `rgb(169, 88, 62)`,深色 `rgb(242, 240, 234)` on `rgb(143, 74, 51)`;禁用 opacity 1;报告范围外对照按钮与基线一致。
- 防复发:报告页按钮颜色只在这段作用域规则里改。全站其它实心 `<button>` 仍有同一问题(浅色 3.33:1、深色 2.57:1):要修应另立单,在全局 `button { color: inherit; }` 或 `Button` 组件层面解决,并逐页截图;不要把这段报告作用域规则挪成全局。
- 相关记录:BUG-738(action 两档对比度)、BUG-1018 / 1019(分块导出);`TASK-chart-types-and-report-buttons-20260928` T7。
- 复发自:无
- 修复版本:待推送