From a963bec3f35f9375ecbdc1abd8724c175d301a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B9=9B=E5=85=AE?= Date: Tue, 27 Oct 2026 15:15:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(experiments):=20=E6=8C=89=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC=E6=B6=88=E8=B4=B9=E5=A4=9A=E7=BB=84?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=AE=9E=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 用户端支持动态组别和未入组状态,不再固定使用B组判断新版界面 - 决策过期使用服务端返回的默认值,保留旧响应兼容 --- README.md | 2 ++ src/components/digital-home.tsx | 7 ++++++- src/lib/digital.ts | 6 ++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5dc4fd7..2486964 100644 --- a/README.md +++ b/README.md @@ -136,3 +136,5 @@ pnpm start:prod `src/components/conversation-row.tsx` 提供会话列表横滑删除、桌面删除入口与模态确认。灵感回复读取本人会话上下文,选择后只加入草稿,原草稿保留;回车发送覆盖 H5/Web,支持中文输入法、Shift+Enter 与手机换行按钮。 内部滚动区域统一隐藏原生轨道,保留触摸/键盘滚动,设定表单关闭横向溢出。风格控制提示使用只读 `GET /api/digital/conversations/:id/style-policy`,打开设定不会写入实验分组、决策或曝光。 + +实验决策支持 A~Z 动态组;未入组时组别为 null。界面消费 `decision.value`(`new` / `true` 为新版),组名仅用于归因。决策过期使用服务端的 `fallbackValue`,不将无实验用户伪装成 A 组;旧服务未返回value时保留既有兼容路径。 diff --git a/src/components/digital-home.tsx b/src/components/digital-home.tsx index 0ec8821..a9b3ecd 100644 --- a/src/components/digital-home.tsx +++ b/src/components/digital-home.tsx @@ -248,6 +248,7 @@ export function DigitalHome({ decision: { ...current.decision, variant: current.decision.fallbackVariant, + value: current.decision.fallbackValue, decisionId: null, }, } @@ -993,7 +994,11 @@ export function DigitalHome({ }, [], ); - const modern = boot?.decision.variant === "B"; + // UI按消费者返回值决定,组名仅用于归因;C到Z同样可以返回新版UI。 + // 缺少value时兼容尚未升级的服务响应。 + const modern = boot?.decision.value !== undefined + ? boot.decision.value === "new" || boot.decision.value === true + : boot?.decision.variant === "B"; return (