diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ee4cb93..01966e5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ - 🧪 测试:`tests/settings-nav-icon.spec.tsx` 钉住图标按宿主给的 `size` 缩放、只用 `currentColor`;真实宿主上用无头浏览器确认导航行只剩一个 `svg`、无残留标记。 - 🪟 **浮层不再把自己的标题栏摆进桌面壳的原生窗口控件带**([#805](https://github.com/omdsh-dev/DSH-better-sidebar/issues/805) 同根因):Windows 桌面壳用 `titleBarOverlay` 在视口顶部画原生「最小化/最大化/关闭」,那条带子里的指针事件到不了网页。任务详情浮窗(`FloatingWindow`)的最小顶部距离写死 8px、自身标题栏 34px,× 正好落在带子里点不动;节点详情弹层(`AnchoredPopover`)与 mermaid 放大图工具栏同理。新增 `src/client/viewport-inset.ts` 读标准 `navigator.windowControlsOverlay`(`visible` + `getTitlebarAreaRect()`,订阅 `geometrychange`,`resize` 兜底)求出带高,三处消费者把可交互区压在带子下方;拖拽/重排的纵向下限同步,带子出现时把已摆好的浮层抬起、消失时不主动下拉(用户摆的位置不被最大化/还原弹走)。**只读探测、零配置**:不写 CSS 变量、不写 DOM 属性、不加偏好键、不复活 #430 删掉的 `--dsh-title-bar-strip`;API 缺失 / `visible:false` / 读取抛错一律退化为 0,普通浏览器与网页版的位置与今天逐字一致。 - - 🧪 测试:新增 `tests/viewport-inset.spec.ts`(9 例:API 缺失 / 高度 0 / `visible:false` / 抛错 / 小数取整 / `y+height` 取值 / `geometrychange` 增删 / 换源清理监听);`tests/floating-window.spec.tsx` 新增 5 例(锚点在带内抬起 / 拖拽不越界 / 带子出现抬起 / 带子消失不下拉 / 幽灵接口保持原 8px);挂载 lane 注入假 WCO 断言放大图工具栏 16→52→16 的真实布局。 + - 🧪 测试:新增 `tests/viewport-inset.spec.ts`(11 例:API 缺失 / 读到带高 / 高度 0 / `visible:false` / 抛错 / 小数取整 / `y+height` 取值 / 只在值真变时通知 / `resize` 兜底 / `visible` 运行时翻转 / 换源清理监听);`tests/floating-window.spec.tsx` 新增 6 例(锚点在带内抬起 / 拖拽不越界 / 带子出现抬起 / 带子消失不下拉 / 高度上限让出带子 / 幽灵接口保持原 8px);新增 `tests/anchored-popover.spec.tsx`(3 例:带内抬起 / 无带子保持原位 / 视口最顶保持历史位置);挂载 lane 注入假 WCO 断言放大图工具栏 16→52→16 的真实布局。 ### v0.30.0 diff --git a/CHANGELOG_EN.md b/CHANGELOG_EN.md index e1c65be1..c5dd2dbf 100644 --- a/CHANGELOG_EN.md +++ b/CHANGELOG_EN.md @@ -10,7 +10,7 @@ - 🧪 `tests/settings-nav-icon.spec.tsx` pins the glyph to the slot-provided `size` and `currentColor`; a headless pass against a real host confirms one `svg` in the row and no leftover marker. - 🪟 **Floating layers no longer place their own title bar under the desktop shell's native window-control band** (same root cause as [#805](https://github.com/omdsh-dev/DSH-better-sidebar/issues/805)): on Windows the shell paints its native minimize/maximize/close buttons over the top band of the viewport with `titleBarOverlay`, and pointer events in that band never reach the page. The task-detail window (`FloatingWindow`) had a hard-coded 8px top floor with a 34px title bar, so its × landed inside the band and could not be clicked; the node-detail popover (`AnchoredPopover`) and the mermaid zoom toolbar had the same problem. New `src/client/viewport-inset.ts` reads the standard `navigator.windowControlsOverlay` (`visible` + `getTitlebarAreaRect()`, `geometrychange` with a `resize` fallback) and all three consumers keep their interactive area below the band; vertical drag/re-layout floors follow it, an appearing band lifts an already-placed layer, and a disappearing band never pulls it back up (maximize/restore does not move what the reader placed). **Read-only probe, zero configuration**: no CSS variable, no DOM attribute, no preference key, no revival of the `--dsh-title-bar-strip` mechanism removed in #430; a missing API, `visible:false`, or a throwing read degrade to 0, so plain browsers and the web build behave exactly as before. - - 🧪 Tests: new `tests/viewport-inset.spec.ts` (9 cases); 5 new cases in `tests/floating-window.spec.tsx`; the mount lane injects a fake WCO and asserts the zoom toolbar's real layout moves 16→52→16. + - 🧪 Tests: new `tests/viewport-inset.spec.ts` (11 cases); 6 new cases in `tests/floating-window.spec.tsx`; new `tests/anchored-popover.spec.tsx` (3 cases); the mount lane injects a fake WCO and asserts the zoom toolbar's real layout moves 16→52→16. ### v0.30.0 diff --git a/docs/external-plugin-guide.md b/docs/external-plugin-guide.md index f11e7642..40c4ea59 100644 --- a/docs/external-plugin-guide.md +++ b/docs/external-plugin-guide.md @@ -1248,7 +1248,7 @@ interface SettingsDescriptor { - **用户空间 CSS(v0.14.1+;titleBar 让位机制移除后只剩它)**:`SidebarPrefs.customCss`(设置页「自定义 CSS」分组)注入 `