Skip to content

fix(web): keep phone drawer backdrop blur aligned on WebKit - #1080

Merged
iruriQ merged 1 commit into
BytePioneer-AI:mainfrom
mythezone:fix/web-phone-drawer-backdrop
Nov 25, 2026
Merged

iruriQ merged 1 commit into
BytePioneer-AI:mainfrom
mythezone:fix/web-phone-drawer-backdrop

Conversation

@mythezone

@mythezone mythezone commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

修复手机端 Web 左侧滑出抽屉(.phoneDrawer)在支持 corner-shape 的 WebKit(如 iOS 27.3 / macOS 27.3 Safari)下毛玻璃背景向右下偏移、左侧与顶部出现未模糊透底条带的问题。

根因分析

  1. apps/web-ui/packages/client/ui-theme/src/styles/corner-shape.css 通过全局选择器 *, *::before, *::after 施加了 corner-shape: superellipse(1.5)。
  2. .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)。
  3. 在 WebKit 的 corner-shape backdrop-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 覆盖规则
  • Safari 27.3(macOS 27.3,WebKit 22626.1.12.11.4,CSS.supports("corner-shape", "superellipse(1.5)") === true)420×840 手机视口隔离环境修复前后实测:
    • 使用独立空数据目录对比 main 基线与本 PR,覆盖插件页(亮色 / 暗色)与首页(亮色)。
    • 修复前稳定复现左侧 ~31px 竖向分界线与顶部 ~27px 按钮/标题清晰透底;修复后 .phoneDrawer 计算值为 superellipse(1)(即 round),左侧与顶部未模糊条带完全消除,全宽毛玻璃与右侧 28px 圆角、阴影及暗色高光保持一致。
  • Xcode iOS 27.2(Build 24B8117,iPhone 17)模拟器验证:该版本 Safari 中 CSS.supports("corner-shape", "superellipse(1.5)") === false,基线与修复后均正常无回归(也印证了此前 iOS 27.2 未触发的原因)。
  • iOS 27.3 Safari 真机对比:尚未在该分支单独采集 iPhone 实机修复后截图(问题原始复现来自 iPhone Safari,且与上述 Safari 27.3 共用同一 WebKit GraphicsLayerCA 路径;如需实机补图可继续补充)。按 AGENTS.md 约定未新增 Web 页面浏览器测试。

Screenshots

以下截图均采自 Safari 27.3(WebKit 27.3,CSS.supports("corner-shape", "superellipse(1.5)") === true)420×840 手机视口,使用隔离空数据目录(无个人会话/隐私信息),仅裁去浏览器顶栏工具条。

插件页 · 亮色主题(Before vs After)

Plugins Light Before vs After

插件页 · 暗色主题(Before vs After)

Plugins Dark Before vs After

首页 · 亮色主题(Before vs After)

Home Light Before vs After

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T03:30:22.903455Z f89ed54 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • 样式
    • 优化手机端抽屉的圆角效果,使其与背景模糊和外阴影更协调。

.phoneDrawer 新增 corner-shape: round 声明,并添加注释,说明该属性用于使圆角与背景模糊及外阴影对齐。

Changes: 移动端抽屉样式

Layer / File(s) Summary
抽屉圆角形状
apps/web-ui/packages/client/ui-layout/src/client/AppFrame.module.css
.phoneDrawer 新增 corner-shape: round 声明。注释说明该属性与背景模糊及外阴影的对齐关系。

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Possibly related issues

Possibly related PRs

Suggested reviewers: bytepioneer-ai, yuanruoyu515

Merge Risk: Minimal · up to f89ed

This adds a small CSS override to the mobile drawer to fix a WebKit backdrop-blur offset. The risk is low and the change is easy to revert. The fix has not yet been checked on a real iOS Safari device, so the author should confirm the result there.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 标题“fix(web): keep phone drawer backdrop blur aligned on WebKit”概括了主要改动:修复 WebKit 上手机抽屉背景模糊错位。改动仅为 .phoneDrawer 添加 corner-shape: round,与标题描述的修复目标一致。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed PR 描述与变更集高度相关。描述说明了 AppFrame.module.css 中 .phoneDrawer 的问题根因(全局 corner-shape 规则、box-shadow 与 backdrop-filter 在 WebKit 中的裁剪路径),并列出在 .phoneDrawer 中新增 corner-shape: round 的具体改动、保留的样式以及测试计划与截图。描述详细且具体,未偏离…
Full details: Description check

Explanation

PR 描述与变更集高度相关。描述说明了 AppFrame.module.css 中 .phoneDrawer 的问题根因(全局 corner-shape 规则、box-shadow 与 backdrop-filter 在 WebKit 中的裁剪路径),并列出在 .phoneDrawer 中新增 corner-shape: round 的具体改动、保留的样式以及测试计划与截图。描述详细且具体,未偏离主题。

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@iruriQ

iruriQ commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

感谢贡献与扎实的 WebKit 根因分析!改动仅 2 行非常克制,但按项目验收规范,由于目前作者与本机都尚未在支持 corner-shape 的 iOS 27 Safari 真机上完成复现与修复前后对比验证,暂无法直接给出合并结论。方便的话请补充 iOS 27 Safari 真机验证结果与脱敏前后对比图,确认后即可快速合入。

@iruriQ iruriQ added the awaiting-author Waiting for the author to respond or update the PR. label Nov 23, 2026
@mythezone

Copy link
Copy Markdown
Author

@iruriQ 感谢反馈!已补充同源 WebKit 27.3 / Safari 27.3(CSS.supports("corner-shape", "superellipse(1.5)") === true)下的修复前后脱敏对比验证,并同步更新了 PR 正文的 Test plan 与截图:

实测环境与结果

  • 验证环境:macOS 27.3 / Safari 27.3(22626.1.12.11.4,WebKit 27.3,CSS.supports("corner-shape", "superellipse(1.5)") === true),窗口缩放至 420×840 手机视口(触发 .phoneDrawer 手机抽屉),使用独立隔离空数据目录分别运行 main 基线与本 PR 产物(零个人会话数据,截图已裁去浏览器顶栏)。
  • 修复前(main 基线):在插件页(亮色/暗色)与首页均 100% 复现与 iPhone 相同的现象——抽屉左侧 ~31px 处出现笔直竖向模糊分界线,左缘文字/图标/边框与顶部按钮在 ~27px 范围内清晰透出;暗色下底部按钮光晕也被该竖线生硬截断。
  • 修复后(PR fix(web): keep phone drawer backdrop blur aligned on WebKit #1080):.phoneDrawer 计算样式为 corner-shape: superellipse(1)(round),左侧与顶部的未模糊条带及竖向分界线完全消除,毛玻璃材质(38% 填充 + blur(18px))、右侧 28px 圆角、阴影与暗色高光均保持不变。
  • 附注(iOS 27.2 模拟器对照):同时实测了 Xcode 的 iPhone 17(iOS 27.2,Build 24B8117)模拟器,其 Safari 中 CSS.supports("corner-shape", "superellipse(1.5)") === false,不进入 corner-shape 分支,基线与修复后均正常无回归(这也解释了之前 iOS 27.2 设备未能复现,而支持 corner-shape 的 27.3 WebKit 会稳定触发)。

说明:以下对比图采集自同源 WebKit 27.3 的 macOS Safari 27.3(420×840 手机视口),并非 iPhone 真机截图;如仍需要 iOS 27.3 iPhone 真机上的二次实拍,我可以继续补传。

插件页 · 亮色主题(Before vs After)

Plugins Light Before vs After

插件页 · 暗色主题(Before vs After)

Plugins Dark Before vs After

首页 · 亮色主题(Before vs After)

Home Light Before vs After

@iruriQ
iruriQ merged commit 1212956 into BytePioneer-AI:main Nov 25, 2026
6 of 8 checks passed
@iruriQ iruriQ removed the awaiting-author Waiting for the author to respond or update the PR. label Nov 25, 2026
@iruriQ

iruriQ commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

感谢补充 WebKit 27.3 修复前后对比验证与截图,已合入 main!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants