fix(floating): 修正控件带通知与无带子时的布局偏差

viewport-inset 的快照原本是 { top } 对象,重读时每次新建,引用比较永远不等:
带子存在时每次 resize / geometrychange 都会广播,三个浮层各重渲染一次。改为
直接存数字,值不变就不通知。

AnchoredPopover 新增的让位原本无条件执行,普通浏览器里锚点贴到视口最顶时
弹层会从 6px 变 8px,与「无带子时逐字等价」的承诺不符。改为只在带子存在时
才抬高。

顺带删除 mermaid 工具栏里恒被内联样式覆盖的 CSS top(不跑 JS 时该弹层不存在,
不是降级),并补上测试:同值不广播、resize 兜底、visible 运行时翻转、浮窗
高度让位、AnchoredPopover 三个位置用例。

文档:接入指南的 WCO 例外改标「尚未发布」(v0.29.0 从未发布到 npm),计划
文档修正 #430 对照表与测试清单。
This commit is contained in:
unsc9 committed 2026-11-05 13:16:39 +08:00
1 parent 353a234cf4
commit a9c2ff0fce
10 files changed
+164 -57

No files matched your search

+2 -4
View File
@@ -2055,12 +2055,10 @@ body[data-dsh-sidebar-dragging] .bottomPanel {
backdrop-filter: blur(2px);
}
/* `top` is written inline by mermaid.tsx (it has to clear the shell's native
window-control band, #805). */
.mermaidModalToolbar {
position: absolute;
/* Fallback only: mermaid.tsx sets an inline `top` that also clears the
shell's native window-control band, which swallows pointer events (#805).
Kept here so the toolbar still lands somewhere sane if that never runs. */
top: 16px;
right: 16px;
display: flex;
gap: 8px;