Repository navigation
fix(web): keep phone drawer backdrop blur aligned on WebKit - #1080
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
感谢贡献与扎实的 WebKit 根因分析!改动仅 2 行非常克制,但按项目验收规范,由于目前作者与本机都尚未在支持 |
|
@iruriQ 感谢反馈!已补充同源 WebKit 27.3 / Safari 27.3( 实测环境与结果
插件页 · 亮色主题(Before vs After)插件页 · 暗色主题(Before vs After)首页 · 亮色主题(Before vs After) |
|
感谢补充 WebKit 27.3 修复前后对比验证与截图,已合入 |



Summary
修复手机端 Web 左侧滑出抽屉(
.phoneDrawer)在支持corner-shape的 WebKit(如 iOS 27.3 / macOS 27.3 Safari)下毛玻璃背景向右下偏移、左侧与顶部出现未模糊透底条带的问题。根因分析
apps/web-ui/packages/client/ui-theme/src/styles/corner-shape.css通过全局选择器*, *::before, *::after施加了corner-shape: superellipse(1.5)。.phoneDrawer同时具备:border-radius: 0 28px 28px 0(继承了非round的corner-shape);box-shadow: 8px 12px 36px -12px rgb(0 0 0 / 0.24),使合成层产生非零内容偏移contentOffsetInCompositingLayer()(约左侧31px、顶部27px);backdrop-filter: blur(18px)。corner-shapebackdrop-filter裁剪路径(WebKit bug 322509 /4b267e8636)中:RenderLayerBacking::updateBackdropFiltersGeometry()在hasNonRoundCornerShape()为真时,会将m_backdropFiltersShapePath按contentOffsetInCompositingLayer()平移;GraphicsLayerCA::updateBackdropFiltersRect()在调用updateClippingStrategy()前已将m_backdropLayer定位到m_backdropFiltersRect.rect().location()并把传入的backdropRectRelativeToBackdropLayer位置清零;updateClippingStrategy()因此对m_backdropFiltersShapePath少减了一次层偏移,导致CAShapeLayer遮罩在CABackdropLayer内部被二次向右下偏移约(31px, 27px)。结果抽屉左侧约31px、顶部约27px的区域失去背景模糊,下层页面的文字/边框/顶栏按钮直接清晰透出,并形成一条固定竖向分界线。改动内容
apps/web-ui/packages/client/ui-layout/src/client/AppFrame.module.css的.phoneDrawer中补充corner-shape: round;(与同文件.centerCol的写法一致),跳过 WebKit 的m_backdropFiltersShapePath分支,改走已对齐的圆角矩形遮罩路径。38%填充 +blur(18px))、右侧28px圆角、阴影、暗色高光、壁纸模式以及prefers-reduced-transparency/prefers-contrast/forced-colors规则(呼应 Fix phone drawer see-through on mobile web #1051 保留毛玻璃样式的结论)。Related issues
Test plan
npx prettier --check apps/web-ui/packages/client/ui-layout/src/client/AppFrame.module.css— 通过node tools/check-boundaries.mjs— 通过git diff --check— 通过npm run build:web:ui— 构建成功,确认产物 CSS 包含.phoneDrawer的corner-shape: round覆盖规则22626.1.12.11.4,CSS.supports("corner-shape", "superellipse(1.5)") === true)420×840 手机视口隔离环境修复前后实测:main基线与本 PR,覆盖插件页(亮色 / 暗色)与首页(亮色)。~31px竖向分界线与顶部~27px按钮/标题清晰透底;修复后.phoneDrawer计算值为superellipse(1)(即round),左侧与顶部未模糊条带完全消除,全宽毛玻璃与右侧28px圆角、阴影及暗色高光保持一致。24B8117,iPhone 17)模拟器验证:该版本 Safari 中CSS.supports("corner-shape", "superellipse(1.5)") === false,基线与修复后均正常无回归(也印证了此前 iOS 27.2 未触发的原因)。GraphicsLayerCA路径;如需实机补图可继续补充)。按AGENTS.md约定未新增 Web 页面浏览器测试。Screenshots
插件页 · 亮色主题(Before vs After)
插件页 · 暗色主题(Before vs After)
首页 · 亮色主题(Before vs After)