fix(chat): one gradient across the whole timeline; unknown tones never print undefined (BUG-2319)
Independent Staging Quality Gate / validate-frontend (push) Successful in 5m59s
Independent Staging Quality Gate / validate-python (push) Successful in 7m55s
Independent Staging Quality Gate / publish (push) Successful in 3m24s

Each block now shows its own slice of a single horizontal gradient whose stops sit
at the middle of each stretch, instead of 有机会,但费力 carrying its own small
gradient. A tone the page does not know (a receipt from another release) shows no
words and the neutral fill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXp2Vp62Ur3C7yRWQdSq
This commit is contained in:
2026-11-24 15:22:32 +08:00
co-authored by Claude Opus 5.5
parent a30dc7a658
commit 40fa2b1128
6 changed files with 115 additions and 18 deletions
+12
View File
@@ -31265,3 +31265,15 @@
- 复审真实路由(同上桩,每题一次):事业 6 段 有机会 / 有机会 / 有机会,但费力 / 较费力 / 有机会,但费力 / 有机会,但费力;感情 5 段 有机会 / 不标 / 有机会,但费力 / 有机会 / 有机会;钱 7 段 较费力 / 不标 / 有机会 / 有机会,但费力 / 较费力 / 有机会 / 有机会。三条回答的时间条和结论卡里没有工程用词、两头的话、「平稳」「偏吃力」;年度底色都写进了结论那一句。截图已换成这一轮。
- 测试:`chat-strip-status-2310` 每条规则分整年和窗口内两层各测,加年度底色、结论卡两头的话、判断依据重复行的写法,共 18 条。
- 修复版本:分支 `claude/timeline-ruling-2310`(本地提交,未推送)。
## BUG-2319 | 问答时间条「有机会,但费力」每块各自一段小渐变,整条看着一截一截;旧页面读新回执时显示「undefined」
- 状态:fixed-pending-verify
- 现象:负责人 2026-11-24 手机测试 staging(a30dc7a6):时间条上「有机会,但费力」的每一块都在块内从绿过渡到陶土色,几块并排像一截一截的小渐变;负责人要求「整个时间轴一个渐变」。同一轮里,部署前已打开的页面显示新回答时,时间条说明后出现「undefined」,色块全空白。
- 触发条件:(1)回答里有「有机会,但费力」的段;(2)页面在 BUG-2310 部署前打开,未刷新,回答由新服务端生成。
- 根因:(1)BUG-2310 复审把「有机会,但费力」做成块内两色渐变,每块按说法各用一个类单独上色,块与块之间没有关系。(2)BUG-2310 前的页面代码按旧取值(steady / heavy)查说法文字,查不到时直接把 undefined 拼进「起止,说法」;新回执的取值(chance / chance_costly / strain / none)它都不认识,样式类也对不上。
- 修复:`chat-answer-shape.tsx` 新增 `stripSliceStyles`:整条时间条只算一个横向渐变,每段的颜色放在该段正中,与相邻段自然过渡;每块的背景尺寸取整条宽、位置移到自己那一段,显示整条渐变里属于自己的一片。「有机会,但费力」改成绿和陶土之间的一个中间色(`--strip-chance-costly`),不再块内渐变;图例色块用同一组颜色。说法文字的查找改为认不出就不显示(`toneWords`),颜色认不出就用中性色(`stripToneColor`),任何取值都不会拼出 undefined。还在生成、没有回执时仍是中性色。
- 验证:新增 `tests/chat-strip-gradient-2319.test.tsx`(一条渐变、每块切片的尺寸与位置、单段与无回执、未知取值不出 undefined);`chat-answer-shape-2281`、`chat-answer-end-2305` 的类名断言按原值 / 新值 / 原因改为检查同一条渐变与图例颜色;改动文件相关的测试与三个守护测试逐个跑过;tsc、ESLint 0 错误。截图(组件渲染 + 产品样式,非真实页面):`/workspace/eval-read-1116/chat-ux-prototype/build/strip-gradient-2319/`。
- 防复发:展示层读回执里的取值时,一律对未知取值兜底(不显示文字、中性色),不得直接拼接查表结果。发版后旧页面读新数据的整体问题见工单 #359。
- 关联记录:BUG-2310(时间条按领域判断、新取值)、BUG-2305(时间条样式与回执说法)、BUG-2281(回答结构)。
- 修复版本:分支 `claude/strip-gradient`。