Compare commits

..

2 Commits

Author SHA1 Message Date
zhanxi afc474b0c4 Merge pull request 'fix(experiments): 发布多组决策消费支持' (#9) from feature/env-pipeline-split into master 2026-10-27 07:15:54 +00:00
湛兮 a963bec3f3 fix(experiments): 按决策返回值消费多组界面实验
- 用户端支持动态组别和未入组状态,不再固定使用B组判断新版界面
- 决策过期使用服务端返回的默认值,保留旧响应兼容
2026-10-27 15:15:21 +08:00
3 changed files with 12 additions and 3 deletions
+2
View File
@@ -136,3 +136,5 @@ pnpm start:prod
`src/components/conversation-row.tsx` 提供会话列表横滑删除、桌面删除入口与模态确认。灵感回复读取本人会话上下文,选择后只加入草稿,原草稿保留;回车发送覆盖 H5/Web,支持中文输入法、Shift+Enter 与手机换行按钮。 `src/components/conversation-row.tsx` 提供会话列表横滑删除、桌面删除入口与模态确认。灵感回复读取本人会话上下文,选择后只加入草稿,原草稿保留;回车发送覆盖 H5/Web,支持中文输入法、Shift+Enter 与手机换行按钮。
内部滚动区域统一隐藏原生轨道,保留触摸/键盘滚动,设定表单关闭横向溢出。风格控制提示使用只读 `GET /api/digital/conversations/:id/style-policy`,打开设定不会写入实验分组、决策或曝光。 内部滚动区域统一隐藏原生轨道,保留触摸/键盘滚动,设定表单关闭横向溢出。风格控制提示使用只读 `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: { decision: {
...current.decision, ...current.decision,
variant: current.decision.fallbackVariant, variant: current.decision.fallbackVariant,
value: current.decision.fallbackValue,
decisionId: null, 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 ( return (
<div <div
className={`dh-app ${modern ? "dh-modern" : "dh-classic"} ${conversation ? "dh-in-chat" : ""}`} 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[]; catalog: Card[];
profile: Profile; profile: Profile;
decision: { decision: {
variant: "A" | "B"; variant: string | null;
value?: unknown;
fallbackValue?: unknown;
decisionId: string | null; decisionId: string | null;
expiresAt: number; expiresAt: number;
fallbackVariant: "A" | "B"; fallbackVariant: string | null;
}; };
serverNow: number; serverNow: number;
}; };