Skip to content

fix: macOS 下禁用橡皮筋回弹效果 避免列表滚动时滚动条占位导致布局抖动 - #4071

Closed
hjhke wants to merge 0 commit into
masterfrom
hejiahui/fix/mac_overflow
Closed

fix: macOS 下禁用橡皮筋回弹效果 避免列表滚动时滚动条占位导致布局抖动#4071
hjhke wants to merge 0 commit into
masterfrom
hejiahui/fix/mac_overflow

Conversation

@hjhke

@hjhke hjhke commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

第二个合并方式

@hjhke hjhke added the need more test 需要更多的测试 label Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR CI 汇总

状态:全部通过

  • ✅ i18n(renderer src/main zh/zh-TW/en)
  • ✅ i18n(engine-link zh/zh-TW/en)
  • ✅ ESLint(renderer src/main)
  • ✅ TypeScript(renderer src/main)
  • ✅ ESLint(engine-link-startup)
  • ✅ TypeScript(engine-link-startup)
  • ✅ 图片/视频体积
  • ○ Vitest(main / renderer / engine-link;test 同目录·别名·相对路径)(skipped)
  • ✅ Prettier

由 pull_request test workflow 自动生成

Copilot AI 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.

Pull request overview

该 PR 旨在在 macOS 下抑制页面的 overscroll 橡皮筋回弹,并通过调整滚动容器样式来减少列表滚动时滚动条占位带来的布局抖动(主要涉及入口全局样式开关与 HTTPHistory 左侧面板滚动行为调整)。

Changes:

  • 在渲染端入口基于平台判断为 macOS 时,给 html 增加 macos-scroll-fix class 以启用对应全局样式
  • 新增 macos-scroll-fix 相关 CSS:设置高度/overscroll-behavior,并在 macOS 下隐藏 body 的纵向滚动
  • 调整 HTTPHistory 左侧 tab 内容区与列表区的滚动/overscroll 行为(包括 min-height: 0 以修复 flex 子项滚动)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
app/renderer/src/main/src/utils/monacoSpec/yakCompletionHint.ts isMacPlatform 改为导出,供外部复用
app/renderer/src/main/src/index.tsx macOS 时注入 macos-scroll-fix class 以启用全局滚动修复
app/renderer/src/main/src/index.css 增加 macos-scroll-fix 的全局 overscroll/overflow 样式
app/renderer/src/main/src/components/HTTPHistory.module.scss 调整滚动容器的 overflow/overscroll,减少滚动冲突与抖动

Comment thread app/renderer/src/main/src/index.tsx Outdated
Comment on lines +23 to +30
import { isMacPlatform } from './utils/monacoSpec/yakCompletionHint'

const MONACO_WORKER_BASE = 'static/js/monaco'

// macOS 下禁用橡皮筋回弹效果(overscroll),避免与页面内滚动区域冲突造成卡顿
if (isMacPlatform()) {
document.documentElement.classList.add('macos-scroll-fix')
}
Comment thread app/renderer/src/main/src/utils/monacoSpec/yakCompletionHint.ts Outdated
@hjhke
hjhke force-pushed the hejiahui/fix/mac_overflow branch from d18361f to b9c2a6f Compare July 31, 2026 09:17
@hjhke hjhke added WIP: work in progress and removed need more test 需要更多的测试 labels Jul 31, 2026
@hjhke hjhke closed this Aug 3, 2026
@hjhke
hjhke force-pushed the hejiahui/fix/mac_overflow branch from b9c2a6f to 2a372f4 Compare August 3, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants