fix(settings): 设置弹窗用 Portal 渲染避免被页面滚动条覆盖 (#580)#628
Merged
Conversation
在历史/风格页滚动后打开设置弹窗,WebKitGTK(Debian/KDE Wayland)下页面自绘滚动条 (.ol-thinscroll) 会盖在弹窗之上。根因:弹窗用 position:absolute 处于页面 overflow:hidden 祖容器的同一 stacking context 内,而 WebKitGTK 滚动条不创建独立合成层,z-index 对其无效 (issue #580 中 position:fixed、isolation:isolate 均无效已验证)。 - SettingsModal 改用 createPortal 渲染到 document.body,彻底脱离页面 DOM 树与 stacking context(与 SelectLite 的 popover 同款做法)。 - 遮罩层 position 由 absolute 改为 fixed,覆盖整窗;视觉与交互不变。 - 设计 token 定义在 :root,body 下的 portal 正常继承,无样式丢失。
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
H-Chris233
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
背景
issue #580:在历史记录页 / 风格页上下滑动后打开设置弹窗,页面的自定义滚动条(
.ol-thinscroll)会覆盖在设置弹窗之上。报告者环境 Debian KDE Wayland(WebKitGTK),仅在滚动时出现。根因
SettingsModal遮罩层用position: absolute; z-index: 50,但它和页面滚动条处在同一个overflow: hidden祖容器的 stacking context 内。WebKitGTK 下滚动条是元素自绘的一部分,不创建独立合成层,z-index对其无效。issue 中已验证position: fixed、主容器isolation: isolate均无效——因为问题不在 z-index 数值,而在于弹窗没有脱离那个 stacking context。改动(仅
SettingsModal.tsx,单一职责)createPortal把弹窗渲染到document.body,彻底脱离页面 DOM 树与overflow:hidden祖容器的 stacking context(与现有SelectLitepopover 同款做法)。position由absolute改为fixed,覆盖整窗;视觉与交互(点遮罩关闭、毛玻璃背景、居中卡片动画)均不变。:root,body下的 portal 正常继承,无样式丢失。验证
npm run build(tsc + vite)✅🤖 Generated with Claude Code
PR Type
Bug fix
Description
用 Portal 渲染设置弹窗,脱离 stacking context
遮罩层改为 fixed 覆盖整窗
修复 WebKitGTK 下滚动条覆盖问题
File Walkthrough
SettingsModal.tsx
设置弹窗使用 Portal 渲染openless-all/app/src/components/SettingsModal.tsx
createPortalcreatePortal将弹窗渲染到document.bodyposition从absolute改为fixed