Skip to content

fix(dashboard): scope native scrollbar styles to Firefox - #10760

Open
DOTBave wants to merge 1 commit into
AstrBotDevs:masterfrom
DOTBave:fix/dashboard-safari-scrollbar
Open

DOTBave wants to merge 1 commit into
AstrBotDevs:masterfrom
DOTBave:fix/dashboard-safari-scrollbar

Conversation

@DOTBave

@DOTBave DOTBave commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #10758

On Safari (Safari >= 18.2), the inner scrollbar of the config page is
clipped by the rounded settings cards: it is visible above the cards and
disappears once it overlaps them. Chromium renders the same scrollbar above the
cards. This affects /config and other pages that combine an internal scroll
container with rounded cards (e.g. /settings).

Affected: AstrBot >= v3.5.16 (global scrollbar-width rule) on Safari >= 18.2
with overlay scrollbars; verified on macOS 27.0.1 + Safari 27.0.1.

Root cause:

  • dashboard/src/scss/components/_VScrollbar.scss applies
    scrollbar-width: thin / scrollbar-color to *. Per CSS Scrollbars 1
    (§2.1/§3.1), non-auto values require browsers to ignore
    ::-webkit-scrollbar, so Chrome 121+/Safari 18.2+ fall back to the native
    overlay scrollbar instead of the intended 10px themed scrollbar.
  • Overlay scrollbars have no gutter, so the rounded v-cards (Vuetify default
    position: relative; z-index: 0) extend underneath the scrollbar.
  • Chromium composites overlay scrollbars above content; WebKit paints the
    scroller's scrollbar before positioned descendants, so Safari clips it at the
    card's rounded corner (see WebKit bug 297440, WONTFIX, and SO 60192029).

Modifications / 改动点

  • dashboard/src/scss/components/_VScrollbar.scss: gate the standard scrollbar
    properties behind @supports not selector(::-webkit-scrollbar) so only
    Firefox uses them. WebKit/Blink go back to the existing themed
    ::-webkit-scrollbar styles (10px classic scrollbar with a gutter), which
    keeps content from covering the scrollbar and fixes the clipping.

  • No JS, API, i18n or dependency changes. One file changed (+7/−4).

  • Note: this restores the previously intended classic 10px themed scrollbar in
    Chrome/Safari instead of the native overlay scrollbar. It is a visual change
    (scrollbar appearance), not a functional breaking change.

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

Verification steps:

  1. Build the Dashboard: cd dashboard && pnpm install --frozen-lockfile && pnpm run build
  2. Start the backend with the fresh build: uv run main.py --webui-dir dashboard/dist
  3. Open /#/config in Safari and Chromium; scroll and observe the scrollbar next to the rounded cards.

Results:

  • Safari: before → scrollbar clipped at the card's rounded corner;
    after → full 10px themed classic scrollbar visible, no clipping.
  • Chromium: scrollbar still works; now renders as the 10px themed classic
    scrollbar (visual change noted above).
  • Safari console: CSS.supports('selector(::-webkit-scrollbar)') === true,
    confirming the @supports branch is evaluated as intended.
  • Firefox: keeps scrollbar-width: thin; scrollbar-color: ... by design;
    not manually tested.

Automated checks:

  • cd dashboard && pnpm install --frozen-lockfile && pnpm run i18n:check && pnpm run build (passed)
  • node --test dashboard/tests/*.test.mjs (83 passed)
  • ruff format --check . / ruff check . (no Python files changed)

Screenshots:

Before (Safari only):
截屏2026-10-25 早上5 43 10

After (Safari/Chromium):
截屏2026-10-25 下午6 46 04


Checklist / 检查清单

  • 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
    / 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。

  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。

  • 📚 I checked the affected WebUI instructions and screenshots in docs/zh and docs/en against the changed navigation, page structure, and labels, and updated them in this PR (or explained why no documentation update is needed). For renamed, moved, or merged entry points, I included an old entry → new entry mapping in the documentation and changelog.
    / 我已对照变化后的 WebUI 入口、页面结构和术语,核对并在本 PR 中更新 docs/zh 和 docs/en 的相关操作说明与截图(或说明无需更新文档的原因)。入口改名、移动或合并时,已在文档和 changelog 中补充 旧入口 → 新入口 对照。

  • 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txt 和 pyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Scope standard scrollbar properties to Firefox so Safari and Chromium use the existing themed scrollbar without clipping.

Bug Fixes:

  • Prevent Safari scrollbar clipping around rounded dashboard cards by preserving the themed classic scrollbar in WebKit and Blink browsers.

Enhancements:

  • Limit standard scrollbar styling to browsers without WebKit scrollbar support, while retaining Firefox-specific scrollbar customization.

scrollbar-width and scrollbar-color are set on every element, which makes
WebKit/Blink ignore the themed ::-webkit-scrollbar rules and fall back to
native overlay scrollbars. Those overlays are painted underneath positioned
cards in scroll containers on Safari, so the config page scrollbar gets clipped
at the card's rounded corner.

Restrict the standard properties to browsers without ::-webkit-scrollbar
support: Firefox keeps thin themed scrollbars, while WebKit/Blink keep the 10px
themed classic scrollbar.
@DOTBave
DOTBave marked this pull request as ready for review October 25, 2026 16:22

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

This branch has not been deployed

No deployments
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.

[Bug] Safari 下配置文件页滚动条被圆角卡片遮挡

1 participant