fix(ui): 隔离设置弹窗打开时的后台滚动区域#776
Open
H-Chris233 wants to merge 2 commits into
Open
Conversation
Fixes Open-Less#580: prevent background thin-scroll areas from scrolling/bleeding through when the Settings modal is open. Adds data-ol-settings-open={settingsOpen ? 'true' : undefined} to the main FloatingShell div and corresponding CSS in tokens.css to set overflow:hidden and hide WebKit scrollbars when the attribute is present. Also adds settings-modal-scroll-isolation.test.mjs to assert the attribute placement and CSS selectors.
Contributor
PR Reviewer Guide 🔍(Review updated until commit 0508352)Here are some key observations to aid the review process:
|
Contributor
|
Persistent review updated to latest commit 0508352 |
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
摘要
Fixes #580。
解决设置弹窗打开时,后台页面
.ol-thinscroll滚动区域仍可滚动、滚动条穿透并覆盖弹窗的问题。通过在FloatingShell根节点增加设置打开状态标记,并在 CSS 层隔离后台滚动区域,避免 WebKitGTK 环境下自定义滚动条绘制到弹窗层之上。修复 / 新增 / 改进
FloatingShell根节点增加data-ol-settings-open属性,用于标记 Settings modal 打开状态。overflow: hidden)。.ol-thinscroll的 WebKit 自定义滚动条,避免 Linux WebKitGTK 下滚动条穿透覆盖弹窗。settings-modal-scroll-isolation.test.mjs:FloatingShell正确挂载data-ol-settings-open属性。SettingsModalDOM 结构,降低对现有 UI 和动画逻辑的影响。兼容
不包含:
SettingsModal渲染方式。对现有用户 / 本地环境 / 构建流程的影响:
测试计划
命令:
npm run build结果:TypeScript 编译及前端构建通过。
命令:
node settings-modal-scroll-isolation.test.mjs结果:测试通过,确认属性挂载和 CSS 隔离规则存在。
证据路径:
openless-all/app/src/components/FloatingShell.tsxopenless-all/app/src/styles/tokens.csssettings-modal-scroll-isolation.test.mjs人工验证:
PR Type
Bug fix
Description
Add
data-ol-settings-openattribute to FloatingShell root when settings modal opensHide background
.ol-thinscrolloverflow and scrollbar via CSS under that attributeAdd test script to validate attribute placement and CSS selectors
Diagram Walkthrough
File Walkthrough
FloatingShell.tsx
Add data attribute for settings open stateopenless-all/app/src/components/FloatingShell.tsx
data-ol-settings-openattribute to the main shell div'true'when settingsOpen is true,undefinedotherwise
tokens.css
Add CSS to isolate background scrollopenless-all/app/src/styles/tokens.css
.ol-thinscrollwhendata-ol-settings-openis presentbleed-through
settings-modal-scroll-isolation.test.mjs
Add test for scroll isolationopenless-all/app/scripts/settings-modal-scroll-isolation.test.mjs
data-ol-settings-openattribute appears exactly once inFloatingShell.tsx
tokens.css
SettingsModal