页面上「对画像的解释」的四个毛病,一次修掉。
## ① 说明写错了 —— 前端自己硬编了一份算法字典
persona-feature-hover.tsx 里的 ALGORITHMS 与后端口径各写各的,已经漂:
· 权益身份只列「商保客户 / 医保结算」2 类,extractor 实际产 5 类;还承诺
「显示保司 + 最近日期」—— description/data 里压根没有这两样
· 转介绍达人写「社交型 = 推外人 ≥3 人」,真实口径是「推荐 ≥3 人**且**带来成交,
直系亲属关系 <3 才归社交型」
· 急迫等级缺档位说明;年龄段 labelValues 写 0-3 / 46-55,与自家 algorithm 的
0-2 / 46-54 自相矛盾
客服是照着这段话跟患者讲的,写错比不写更糟。
改为收进 PERSONA_FEATURE_SPECS[key].display(与 algorithm 口径贴脸放,前端只渲染)。
不新开接口 —— packages/types 本来就是前后端共享的。
新增 tests/persona-spec-drift.spec.ts:registry ↔ 注册表 ↔ 圈人字典三方必须对齐,
每个标签必须有 display —— 光收拢不设闸,过两个月照样漂。
## ② 只给结论不给出处
后端一直存着 evidence.factIds(生产上 rfm + lifecycle 两个特征就占 1 GB),
但 adapt-data 把它写死成 `evidence: []`。现在 /full 透出 evidenceFactIds,
详情页反查同一响应的 facts 渲染「依据 · N 条」(默认 4 行,可展开)。
本地实测证据 id 100% 可解析。factLabel 从 tooth-timeline 抽成共享模块并补齐
结算/预约/就诊/病历等类型 —— 否则证据行会把 `payment_record` 这种表名甩给客服。
## ③ 顺序是随机的
抽屉排序取 `orderBy createdAt`,而同一版 feature 行是一条 createMany 写进去的、
createdAt 完全相同 → 排序实际未定义,生产上呈现为英文 key 字母序:
「急迫等级 = 紧急」排最后一个,「性别」「获客渠道」排最前。
现按用途分三组(跟进要点 / 价值与阶段 / 基础属性),组与组内序都定义在标签卡里。
标签云用同一套序。
## ④ `?` 够不着
原来是 16×16 的 <span>,无 tabindex 无 role、纯 hover —— 键盘、读屏、平板触屏都点不到
(可访问性树里一个都读不出来)。改成 24×24 button,focus 即可唤出说明卡,
aria-label 带标签名。
顺带:「更新于」改用 refreshedAt(就地刷新不升版本,computedAt 会停在旧值,
拿它显示会让客服以为数据比实际更旧);extractor 清单从 module/registry 两处收成一处。
## 验证
432 tests green · pac-web build 通过 · 本地真实数据人工验:
分组与依据渲染正确、hover 内容来自 spec、`?` 可聚焦且 focus 能唤出对应说明卡。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| adapt-data.ts | Loading commit data... | |
| chain-viz.tsx | Loading commit data... | |
| close-opportunity-dialog.tsx | Loading commit data... | |
| drawer.tsx | Loading commit data... | |
| emr-soap-view.tsx | Loading commit data... | |
| execution-api.ts | Loading commit data... | |
| fact-label.ts | Loading commit data... | |
| facts-timeline.tsx | Loading commit data... | |
| mock-data.ts | Loading commit data... | |
| outcome-form.tsx | Loading commit data... | |
| persona-detail-list.tsx | Loading commit data... | |
| persona-display.ts | Loading commit data... | |
| persona-feature-hover.tsx | Loading commit data... | |
| plan-detail-app.tsx | Loading commit data... | |
| plan-detail-types.ts | Loading commit data... | |
| reason-line.tsx | Loading commit data... | |
| script-deep-process.tsx | Loading commit data... | |
| script-viewer.tsx | Loading commit data... | |
| shared.tsx | Loading commit data... | |
| task-drawer.tsx | Loading commit data... | |
| tooth-timeline.tsx | Loading commit data... | |
| use-script-stream.ts | Loading commit data... | |
| use-summary-stream.ts | Loading commit data... |