fix: 邀请卡位置联动——invite-container同款right:0硬编码在bottom-left溢出(用户二次反馈,补齐chat-panel联动遗漏)
测试提取器正则同步收紧(排除联动规则误匹配)。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -40,7 +40,9 @@ def test_invite_panel_ships_hidden():
|
||||
|
||||
def test_invite_container_click_through():
|
||||
"""C:容器 pointer-events:none —— 卡片未展示时整棵子树点击穿透。"""
|
||||
m = re.search(r"\.invite-container \{[^}]*\}", _read("widget.js"))
|
||||
# 行首引号锚定原始定义行——位置联动规则(.widget-container.pos-* .invite-container)
|
||||
# 同样匹配宽松正则,须排除(2026-09-30 邀请卡联动修复时的提取器缺陷)
|
||||
m = re.search(r'"\.invite-container \{[^}]*\}', _read("widget.js"))
|
||||
assert m, "widget.js 缺 .invite-container 规则"
|
||||
assert "pointer-events:none" in m.group(0), \
|
||||
".invite-container 必须 pointer-events:none(防隐形拦截点击)"
|
||||
@@ -92,9 +94,17 @@ def test_position_class_panel_alignment():
|
||||
# 2) 容器挂载位置 class
|
||||
assert '"widget-container pos-" + position' in src, "container 需挂 pos-<position> class"
|
||||
# 3) CSS 联动规则: 左侧模式面板左对齐, 顶部模式面板从顶部向下弹
|
||||
assert ".widget-container.pos-bottom-left .chat-panel { left:0; right:auto; }" in src
|
||||
assert ".widget-container.pos-top-right .chat-panel { top:0; bottom:auto; }" in src
|
||||
assert ".widget-container.pos-top-left .chat-panel { left:0; right:auto; top:0; bottom:auto; }" in src
|
||||
# ⚠️ chat-panel 与 invite-container(邀请卡)是同款 absolute+right:0 定位,
|
||||
# 必须一起联动(2026-09-30 二次线上反馈: 邀请卡漏修同样溢出)
|
||||
for rule_sel, rule_body in [
|
||||
(".widget-container.pos-bottom-left .chat-panel,", None),
|
||||
(".widget-container.pos-bottom-left .invite-container { left:0; right:auto; }", None),
|
||||
(".widget-container.pos-top-right .chat-panel,", None),
|
||||
(".widget-container.pos-top-right .invite-container { top:0; bottom:auto; }", None),
|
||||
(".widget-container.pos-top-left .chat-panel,", None),
|
||||
(".widget-container.pos-top-left .invite-container { left:0; right:auto; top:0; bottom:auto; }", None),
|
||||
]:
|
||||
assert rule_sel in src, f"缺联动规则: {rule_sel}"
|
||||
# 4) pos 规则须在 mobile-host 规则之后注入(同特异性靠顺序决胜, 不得被 bottom:84px 覆盖打断)
|
||||
mobile_rule = ".widget-container.mobile-host .chat-panel { bottom:84px; }"
|
||||
pos_rule = ".widget-container.pos-bottom-left .chat-panel"
|
||||
|
||||
Reference in New Issue
Block a user