Skip to content

fix(drawer): 自定义抽屉滚动条样式并阻止滚动穿透至外部页面#8

Merged
BobDLA merged 2 commits into
BobDLA:mainfrom
shengmingboai:main
Mar 20, 2026
Merged

fix(drawer): 自定义抽屉滚动条样式并阻止滚动穿透至外部页面#8
BobDLA merged 2 commits into
BobDLA:mainfrom
shengmingboai:main

Conversation

@shengmingboai

Copy link
Copy Markdown
Contributor

1、自定义抽屉内部滚动条样式区分l站原有滚动条
2、阻止抽屉内部滚动穿透至外部页面

Copilot AI review requested due to automatic review settings March 20, 2026 01:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the drawer UI styling to visually distinguish the drawer’s scrollbar from the host page and to reduce scroll chaining (“scroll bleed-through”) from the drawer to the underlying page.

Changes:

  • Add overscroll-behavior: contain to the drawer’s main scroll container.
  • Add custom WebKit scrollbar styling for .ld-drawer-body (thumb/track/hover).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/content.css
overflow: auto;
overscroll-behavior: contain;
}

Copilot AI Mar 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overscroll-behavior is not inherited. Since there are other scrollable containers inside the drawer (e.g. .ld-drawer-settings-card also has overflow: auto), scroll chaining can still propagate to the outer page when the user wheels/touches at the top/bottom of those inner scrollers. Consider applying overscroll-behavior: contain (or overscroll-behavior-y) to each scrollable drawer container, or set it on a higher-level wrapper that actually scrolls in all modes.

Suggested change
#ld-drawer-root .ld-drawer-body * {
overscroll-behavior: contain;
}

Copilot uses AI. Check for mistakes.
Comment thread src/content.css
Comment on lines +363 to +377
#ld-drawer-root .ld-drawer-body::-webkit-scrollbar {
width: 6px;
}

#ld-drawer-root .ld-drawer-body::-webkit-scrollbar-track {
background: transparent;
}

#ld-drawer-root .ld-drawer-body::-webkit-scrollbar-thumb {
background: color-mix(in srgb, var(--tertiary, #3b82f6) 40%, transparent);
border-radius: 999px;
}

#ld-drawer-root .ld-drawer-body::-webkit-scrollbar-thumb:hover {
background: color-mix(in srgb, var(--tertiary, #3b82f6) 64%, transparent);

Copilot AI Mar 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scrollbar styling here is WebKit-only (::-webkit-scrollbar*). This extension declares Gecko support in manifest.json, so Firefox users will not see the custom drawer scrollbar. If cross-browser consistency is desired, add the Gecko equivalents (e.g. scrollbar-width / scrollbar-color) on .ld-drawer-body so the drawer scrollbar is customized in Firefox too.

Copilot uses AI. Check for mistakes.
@BobDLA BobDLA merged commit f774207 into BobDLA:main Mar 20, 2026
1 check passed
@BobDLA

BobDLA commented Mar 20, 2026

Copy link
Copy Markdown
Owner

已合并到 main。补了一条对应回归用例 AGENT-CHROME-013,用于覆盖抽屉滚动到底后继续滚轮时外层页面不应跟着滚动的场景;同时补了 Firefox 的滚动条样式回退。

本次验证:

  • Tier 0: bash scripts/check.sh
  • Tier 2: bash scripts/agent-smoke.sh --cdp-port 9222 --cases AGENT-CHROME-001,AGENT-CHROME-005,AGENT-CHROME-013

感谢贡献。

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