fix(experiments): 发布多组决策消费支持 #9

Merged
zhanxi merged 1 commits from feature/env-pipeline-split into master 2026-10-27 07:15:54 +00:00
3 changed files with 12 additions and 3 deletions
Showing only changes of commit a963bec3f3 - Show all commits
+2
View File
@@ -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时保留既有兼容路径。
+6 -1
View File
@@ -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 (
<div
className={`dh-app ${modern ? "dh-modern" : "dh-classic"} ${conversation ? "dh-in-chat" : ""}`}
+4 -2
View File
@@ -123,10 +123,12 @@ export type Bootstrap = {
catalog: Card[];
profile: Profile;
decision: {
variant: "A" | "B";
variant: string | null;
value?: unknown;
fallbackValue?: unknown;
decisionId: string | null;
expiresAt: number;
fallbackVariant: "A" | "B";
fallbackVariant: string | null;
};
serverNow: number;
};