Repository navigation
fix(workspace): tab 条到边回弹与 tab tooltip 间距 - #275
Merged
Merged
Conversation
dockview 7 在 tab 条上有两个互相独立的 scrollLeft 写入者: - tabs.js 用 `deltaX || deltaY` 滚动,但到边直接 return,既不 preventDefault 也不 stopPropagation,把滚势放给下一个监听者; - 自定义 Scrollbar 只累加 deltaY,并在 resize / scroll 重算时用自己 那份可能陈旧的 `_scrollOffset` 回放 scrollLeft(实测把停在 max 的 strip 回写成 0)。 到边后事件落到第二个写入者,横滑残留的 deltaY 把 strip 拽向错轴,再叠 上旧 offset 回放,就是触摸板在两端看到的「回弹」。鼠标滚轮正常是因为 deltaX=0 时第一个写入者仍消费事件并 stopPropagation。 修复改为单一写入者:document 捕获阶段的守卫仍覆盖整个 `.dv-tabs-and-actions-container`,现在 preventDefault 后经 `scrollTabStripByWheel` 按手势主轴推进一次并 clamp 到 [0, max],再 stopPropagation,dockview 两个写入者都收不到事件。到边即停,没有越界或 反向位移的来源;纵向 tab 条走 scrollTop。 同时纠正上一轮的误判:compositor 弹性与此无关。Electron 的 `scroll_bounce_flag.patch` 把 `IsElasticOverscrollSupported()` / `IsElasticOverscrollEnabledOnRoot()` 改成只读 `--scroll-bounce`, `web_contents_preferences.cc` 在 macOS 默认 `scroll_bounce_ = false`, 实测没有任何 Pier 进程带该开关,因此 `OverscrollEffectOnNonRootScrollers` 关与不关都没有影响(那批 main 进程改动已回滚)。 - globals.css 把 `.dv-tabs-container` 与 `.dv-scrollable` 收紧为 `overscroll-behavior: none`,仅作 `scrollbars: "native"` 与开关失效时 的防御 - spec K10 重写为「单一写入者 + 根滚动面 + 逐容器防御」三层,并记录 Electron 弹性开关证据 - 治理测试锁定单一写入者(守卫不得直接写 scrollLeft)与到边 clamp, wheel-guard 用例覆盖主轴、clamp、纵向条与 stopPropagation Co-Authored-By: Claude Code <noreply@anthropic.com>
TooltipContent 未传 sideOffset,继承 @pier/ui 的产品默认 6px。Radix 气泡位 = sideOffset + 箭头高 6,在 34px tab 条上实测气泡离条底 13.5px(含 inline-flex 行盒漂移 1.5)、箭头尖浮空 8.5px,观感与 tab 脱开。 tab 条改用 PANEL_TAB_TOOLTIP_SIDE_OFFSET_PX = 2:实测气泡距条 9.5px、 箭头尖距条 4.5px。只收紧这一处调用点,其它表面仍走 6px 金标准;决策记入 panel-tab-chrome 金标准 K9,并加治理测试锁住两侧取值。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更
scrollLeft写入者(tabs.js到边直接 return 不消费;自定义Scrollbar只累加deltaY并用陈旧_scrollOffset回放)。守卫改为单一写入者:preventDefault后经scrollTabStripByWheel按手势主轴推进一次并 clamp 到[0, max],再stopPropagation。纵向 tab 条走scrollTop。PANEL_TAB_TOOLTIP_SIDE_OFFSET_PX = 2(其它表面仍走产品默认 6px)。tests/unit/renderer/workspace/tab-strip/{scroll-governance,wheel-guard,tooltip-gap-governance}.test.ts。验证
pnpm preflight:ci绿(static + plugin-index + coverage + build)