fix(ui): 宽屏面板统一由 shell.overlay 渲染,不再依赖视图探测 (v0.5.3-local.14)
local.13 用 bt-leftcol 等选择器探测 DS Bot 视图,实测未命中,overlay 实例仍不渲染 (DS Bot 页 dsh-wt_edgeStrip 仍为 0)。改为不依赖探测: - 宽屏面板只由 overlay 实例渲染(sidebar 实例只在窄屏渲染 rail) - overlay 实例补 pointer-events:auto,避免 overlay 容器拦截点击 - findSidebar 增加全局兜底(overlay 里向上找不到侧栏时取第一个可见左栏), 保证细条贴在正确左缘 取舍:sidebar.worktable.project 的宿主项目条目在宽屏下不再渲染(跨座位不可见)。 验证:npm run pack 全绿(edge-panel 6 组 + sidebar-popup 全过),双资产同源 c28cba75…。
This commit is contained in:
@@ -130,7 +130,7 @@ function run() {
|
||||
// 1) 默认(edgeAutoHide 未设置 = 自动隐藏):停靠态渲染细条,面板默认收起
|
||||
{
|
||||
const { component, hooks } = loadComponent()
|
||||
const render = () => hooks.render(component, { wide: true, t: (k) => k })
|
||||
const render = () => hooks.render(component, { wide: true, slotRole: 'overlay', t: (k) => k })
|
||||
let tree = render()
|
||||
assert(byClass(tree, 'dsh-wt_edgeStrip').length === 1, '未渲染左缘细条')
|
||||
assert(byClass(tree, 'dsh-wt_anchor' + 'x').length === 0, 'sanity')
|
||||
@@ -154,7 +154,7 @@ function run() {
|
||||
// 2) 设置开关存在且可切换
|
||||
{
|
||||
const { component, hooks, values } = loadComponent()
|
||||
const render = () => hooks.render(component, { wide: true, t: (k) => k })
|
||||
const render = () => hooks.render(component, { wide: true, slotRole: 'overlay', t: (k) => k })
|
||||
let tree = render()
|
||||
assert(byClass(tree, 'dsh-wt_edgeSettings').length === 1, '设置里缺少侧边栏控制项')
|
||||
const toggle = byClass(tree, 'dsh-wt_edgeSettingsToggle')[0]
|
||||
@@ -170,7 +170,7 @@ function run() {
|
||||
// 3) 固定常开(edgeAutoHide=false):面板常显 + 出现 « 手柄;细条无 hover 展开
|
||||
{
|
||||
const { component, hooks } = loadComponent({ stored: { 'dsh.worktable.view.v1': JSON.stringify({ edgeAutoHide: false }) } })
|
||||
const render = () => hooks.render(component, { wide: true, t: (k) => k })
|
||||
const render = () => hooks.render(component, { wide: true, slotRole: 'overlay', t: (k) => k })
|
||||
let tree = render()
|
||||
assert(byClass(tree, 'dsh-wt_edgePanelWrapOn').length === 1, '固定常开模式下应直接展开')
|
||||
assert(byClass(tree, 'dsh-wt_edgeHandle').length === 1, '固定常开模式应出现 « 手柄')
|
||||
@@ -187,7 +187,7 @@ function run() {
|
||||
// 4) 浮动态不受影响
|
||||
{
|
||||
const { component, hooks } = loadComponent({ stored: { 'dsh.worktable.view.v1': JSON.stringify({ dock: 'float', floatTop: 100 }) } })
|
||||
const tree = hooks.render(component, { wide: true, t: (k) => k })
|
||||
const tree = hooks.render(component, { wide: true, slotRole: 'overlay', t: (k) => k })
|
||||
assert(byClass(tree, 'dsh-wt_float').length >= 1, '浮动态应保留浮动卡片')
|
||||
assert(byClass(tree, 'dsh-wt_edgeStrip').length === 0, '浮动态不应渲染细条')
|
||||
console.log('PASS 4: 浮动态保持原行为,不渲染细条')
|
||||
@@ -196,4 +196,20 @@ function run() {
|
||||
console.log('\nALL EDGE PANEL CHECKS PASSED')
|
||||
}
|
||||
|
||||
// 5) 侧栏实例在宽屏下不渲染(宽屏面板只由 overlay 实例负责)
|
||||
{
|
||||
const { component, hooks } = loadComponent()
|
||||
const tree = hooks.render(component, { wide: true, t: (k) => k })
|
||||
assert(byClass(tree, 'dsh-wt_edgeStrip').length === 0, '侧栏实例在宽屏不应渲染细条')
|
||||
console.log('PASS 5: 侧栏实例宽屏不渲染,避免与 overlay 重复')
|
||||
}
|
||||
|
||||
// 6) 窄屏仍由侧栏实例渲染 rail
|
||||
{
|
||||
const { component, hooks } = loadComponent()
|
||||
const tree = hooks.render(component, { wide: false, t: (k) => k })
|
||||
assert(byClass(tree, 'dsh-wt_rail').length >= 1, '窄屏 rail 应由侧栏实例渲染')
|
||||
console.log('PASS 6: 窄屏 rail 由侧栏实例渲染')
|
||||
}
|
||||
|
||||
run()
|
||||
|
||||
Reference in New Issue
Block a user