feat: 吸收上游 7 个测试文件断言与 placeholder 配置化对齐
上游 ai-kefu → phase1 吸收(Task 11 unit 12): - 拷入 7 个测试文件,import/夹具按目标库重锚(app.engine.* / conftest async_db+build_jiancai_runtime / seed_profiles 提示词锚点) - 补实现(同步自上游): chat_rest 服务端可信 IP(_server_ip/ _merge_client_info,直连场景自报假 IP 不再原样落库);widget.js 与 chat.js 的 data-placeholder 读取(叠加 Task 10 管道:data-* > brand > 中性兜底,tests/test_placeholder_static.py 守卫) - 断言重锚以 jc 主线为准: ev.contact_info 存裸号+等待尾注(e164 走 _cc 派生)、source 值 fallback/customer_stated 口径、推送标注键 号码补全说明、prompt 静态锚按租户(seed_profiles)双测 - 全量回归 459 passed(基线 421 + 吸收 38) Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -11,6 +11,10 @@
|
||||
var position = script.getAttribute("data-position") || "bottom-right";
|
||||
var theme = script.getAttribute("data-theme") || "light";
|
||||
var titleAttr = script.getAttribute("data-title");
|
||||
// 同步自上游 ai-kefu: data-placeholder 显式覆盖输入框占位文案。裸读不带
|
||||
// 默认值——Task 10 管道里默认值在 boot() 推导链尾(读取行给默认会让
|
||||
// brand.placeholder 永远无法生效),tests/test_placeholder_static.py 守卫。
|
||||
var placeholderAttr = script.getAttribute("data-placeholder");
|
||||
var autoOpen = script.getAttribute("data-auto-open") === "true";
|
||||
var whatsappAttr = script.getAttribute("data-whatsapp");
|
||||
var emailAttr = script.getAttribute("data-email");
|
||||
@@ -164,7 +168,7 @@
|
||||
topics = Array.isArray(b.topics)
|
||||
? b.topics.filter(function (t) { return typeof t === "string" && t; })
|
||||
: [];
|
||||
placeholder = b.placeholder || "Type a message...";
|
||||
placeholder = placeholderAttr || b.placeholder || "Type a message...";
|
||||
privacyUrl = b.privacy_url || "";
|
||||
brandSlug = String(b.slug || "default").replace(/[^a-zA-Z0-9_-]/g, "") || "default";
|
||||
if (script.getAttribute("data-debug") === "true") {
|
||||
|
||||
Reference in New Issue
Block a user