From 1f2d2b7f818f73b6da1b8399e90c5316c760e1d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=A4=A9=E5=9B=B0?= <2570024918@qq.com> Date: Tue, 18 Aug 2026 14:18:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(windows):=20=E4=BF=AE=E5=A4=8D=20Git=20?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E9=BC=A0=E6=A0=87=E6=BB=9A=E8=BD=AE=E5=81=B6?= =?UTF-8?q?=E5=8F=91=E6=97=A0=E6=B3=95=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WebView2 会把滚轮锁在 overflow:hidden 的提交行文本上。将滚轮交给真正的滚动容器,并把行内截断改为 overflow:clip,避免 hover 后偶发无法滑动。 Fixes #152 Co-authored-by: Cursor --- .../git/components/log/git-commit-table.tsx | 19 +++++++++++++++---- .../git/components/log/git-graph-row.tsx | 11 +++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/windows/tauri/src/features/git/components/log/git-commit-table.tsx b/windows/tauri/src/features/git/components/log/git-commit-table.tsx index f4cc3443..31c7af7b 100644 --- a/windows/tauri/src/features/git/components/log/git-commit-table.tsx +++ b/windows/tauri/src/features/git/components/log/git-commit-table.tsx @@ -1,5 +1,5 @@ import { useVirtualizer } from "@tanstack/react-virtual"; -import { useEffect, useMemo, useRef } from "react"; +import { useEffect, useLayoutEffect, useMemo, useRef } from "react"; import { ContextMenu, ContextMenuContent, @@ -8,6 +8,7 @@ import { ContextMenuShortcut, ContextMenuTrigger, } from "@/ui/context-menu"; +import { bindScrollContainerWheel } from "@/ui/scroll-container-wheel"; import { CopyIcon as Copy, EyeIcon as Eye, @@ -73,6 +74,12 @@ export function GitCommitTable({ overscan: 14, }); + useLayoutEffect(() => { + const element = scrollRef.current; + if (!element) return; + return bindScrollContainerWheel(element); + }, []); + useEffect(() => { if (!selectedCommit) return; const selectedIndex = visibleRows.findIndex((row) => row.commit.hash === selectedCommit.hash); @@ -183,7 +190,11 @@ export function GitCommitTable({ {t("git.log.date")} -
+
{visibleRows.length === 0 ? (
{query ? t("git.log.noMatch") : t("git.log.noCommits")} @@ -216,10 +227,10 @@ export function GitCommitTable({ title={t("git.log.openDiffHint")} > - + {row.commit.author} - + {row.commit.date} diff --git a/windows/tauri/src/features/git/components/log/git-graph-row.tsx b/windows/tauri/src/features/git/components/log/git-graph-row.tsx index eccda475..ec443c55 100644 --- a/windows/tauri/src/features/git/components/log/git-graph-row.tsx +++ b/windows/tauri/src/features/git/components/log/git-graph-row.tsx @@ -34,7 +34,7 @@ export function GitGraphRow({ row, showDecorations }: { row: GraphRow; showDecor aria-hidden="true" width={width} height={ROW_HEIGHT} - className="shrink-0 overflow-visible" + className="pointer-events-none shrink-0 overflow-visible" > {row.incomingLaneColors.map((colorIndex, lane) => { if (colorIndex === null) return null; @@ -78,13 +78,13 @@ export function GitGraphRow({ row, showDecorations }: { row: GraphRow; showDecor /> -
+
{showDecorations && row.labels.map((label, index) => ( ))} - + {row.commit.message}