mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-30 16:23:35 +08:00
Hovering the tab strip and spinning the wheel now moves the strip
horizontally — same UX as native browser tab bars. The scrollbar itself
stays hidden so the strip looks like clean app chrome.
Three coordinated changes:
1. The scroll region's overflow flips from overflow-x-hidden to
overflow-x-auto so native scroll mechanics kick in. The visible
scrollbar is suppressed via the existing project pattern of
Tailwind arbitrary-value utilities — [scrollbar-width:none]
covers Firefox and modern Chromium, [&::-webkit-scrollbar]:hidden
covers older WebKit and the embedded Electron renderer.
2. New non-passive 'wheel' listener on the scroll region: when the
cursor is over it AND the wheel input is deltaY-dominated (i.e.
a plain vertical mouse wheel, no trackpad), translate to
horizontal scrollLeft and preventDefault so the page below the
tab bar doesn't ALSO scroll. Trackpad horizontal swipe input
(deltaX-dominated) passes through untouched so its native
momentum / direction feel survives.
3. Pre-existing test 'keeps the overflow button flush against window
controls on Windows' selected the scroll region by class name
'.overflow-x-hidden' — bumped to '.overflow-x-auto' to match the
new geometry.
Tested:
- bun run test src/components/layout/TabBar.test.tsx — 27/27 (24
existing + 3 new):
* 'exposes the scroll region with overflow-x-auto and a hidden
scrollbar' — pins the CSS contract
* 'translates a vertical wheel into a horizontal scroll on the
tab strip' — fires wheel{deltaY:120}, asserts scrollLeft=120
* 'passes horizontal wheel input through untouched (trackpad
sideways swipe)' — fires wheel{deltaX:80,deltaY:10}, asserts
scrollLeft unchanged
- bun run lint (desktop tsc --noEmit) — clean
Confidence: high. Scope-risk: narrow — single component, two-line CSS
swap + an isolated effect, no API or store changes.
Co-authored-by: 你的姓名 <you@example.com>
Claude Code Haha Desktop
基于 Tauri 2 + React 的桌面客户端。
开发
bun install
bun run tauri dev
构建
# macOS (Apple Silicon)
./scripts/build-macos-arm64.sh
# Windows (x64, MSI only)
.\scripts\build-windows-x64.ps1
构建产物位于 build-artifacts/ 目录,文件名会显式包含平台、架构和包类型。
常见问题
macOS 提示"已损坏,无法打开"
xattr -cr /Applications/Claude\ Code\ Haha.app