fix(ban): appeal textarea squash and nested tone on the user center entry

- fix(ban): 申诉弹窗「请填写申诉说明」填写框被压成 0px——bindAppealForm
  对全部 textarea 执行 bindAutoHeight,而 grow 对无 maxHeight 属性的元素
  走 else 分支写入 height:0;参考主题申诉说明框为 rows=3 自然高度。
  现 autoHeight 仅对显式声明 autoHeight/maxHeight 的文本框生效
- fix(ban): 申诉弹窗与禁封记录弹窗滚动容器对齐参考主题 max-vh5(50vh,
  内层滚动、外层对话框不滚动);mini-scrollbar 提供细滚动条(悬停才显示,
  无常驻侧边滚动栏);禁封弹窗保持 max-vh7 不变
- fix(ban): 用户中心封禁元信息按钮两层颜色嵌套——外层 but 与内层 badg
  同时带 c-red/c-yellow;现外层 but 为默认按钮色,颜色仅由内层 badg
  承载(1:1 参考主题 zib_get_user_ban_info_link 结构)
- test: 契约测试锁定三处修复(说明框自然高度、max-vh5、外层 but 不重复着色)
This commit is contained in:
2026-09-22 19:46:35 +08:00
parent a4af024f32
commit 7a3f5d7c34
3 changed files with 32 additions and 6 deletions
@@ -208,6 +208,22 @@ test('ban prompt surface mirrors the reference theme modals and block page', ()
assert.match(userBanHelper, /您的申诉正在审核中,请耐心等待/)
assert.match(userBanHelper, /name="data\[/)
assert.match(userBanHelper, /详细的说明更容易通过审核喔/)
// 申诉弹窗滚动容器 1:1 参考主题:scroll-y + mini-scrollbar(无侧边滚动栏)+ max-vh5;
// 说明框保持 rows=3 自然高度(禁封弹窗留言框才有 autoHeight/maxHeight)。
assert.match(userBanHelper, /scroll-y mini-scrollbar max-vh5/)
const appealModalFn = userBanHelper.slice(userBanHelper.indexOf('function aksrt_get_user_ban_appeal_modal'))
const appealModalBody = appealModalFn.slice(0, appealModalFn.indexOf('\n}'))
const appealTextarea = (appealModalBody.match(/<textarea[^>]*>/) || [''])[0]
assert.ok(appealTextarea !== '' && appealTextarea.includes('rows="3"'), 'appeal textarea keeps natural rows=3 height')
assert.ok(!appealTextarea.includes('autoHeight'), 'appeal textarea must not opt into autoHeight')
assert.ok(!appealTextarea.includes('maxHeight'), 'appeal textarea must not carry maxHeight (bindAutoHeight would squash it to 0)')
// JS:autoHeight 仅对显式声明的文本框生效。
assert.match(userBanJs, /querySelectorAll\('textarea\[autoHeight\], textarea\[maxHeight\]'\)/)
// 用户中心元信息按钮:外层 but 不重复状态色,颜色仅由内层 badg 承载。
const infoLinkFn = userBanHelper.slice(userBanHelper.indexOf('function aksrt_get_user_ban_info_link'))
const infoLinkBody = infoLinkFn.slice(0, infoLinkFn.indexOf('\n}'))
assert.match(infoLinkBody, /\$classes = trim\('but p2-10'\s*\./)
assert.ok(!infoLinkBody.includes("'but p2-10 ' . (string) \$state['tone']"), 'outer but must not repeat the badge tone')
// 申诉表单 data[key] 结构与后端兼容。
assert.match(banAppeal, /is_array\(\$_POST\['data'\]\)/)
assert.match(banAppeal, /申诉说明/)