From c2d8277a1af936d5745973b51c21ee61da78c202 Mon Sep 17 00:00:00 2001 From: Slinetrac Date: Wed, 14 Jan 2026 11:23:50 +0800 Subject: [PATCH] fix(connections): allow full-width header sorting without triggering on resize --- Changelog.md | 1 + .../connection/connection-table.tsx | 31 +++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Changelog.md b/Changelog.md index 2b9a60b45..87efeb221 100644 --- a/Changelog.md +++ b/Changelog.md @@ -44,5 +44,6 @@ - 右键错误通知可复制错误详情 - 保存 TUN 设置时优化执行流程,避免界面卡顿 - 补充 `deb` / `rpm` 依赖 `libayatana-appindicator` +- 「连接」表格标题的排序点击区域扩展到整列宽度 diff --git a/src/components/connection/connection-table.tsx b/src/components/connection/connection-table.tsx index d99d01d9d..b9d184a2e 100644 --- a/src/components/connection/connection-table.tsx +++ b/src/components/connection/connection-table.tsx @@ -582,15 +582,10 @@ export const ConnectionTable = (props: Props) => { alignItems: "center", position: "relative", boxSizing: "border-box", - px: 1, - py: 1, fontSize: 13, fontWeight: 600, color: "text.secondary", userSelect: "none", - justifyContent: - meta?.align === "right" ? "flex-end" : "flex-start", - gap: 0.25, "&:hover": { backgroundColor: (theme) => theme.palette.action.hover, @@ -599,15 +594,26 @@ export const ConnectionTable = (props: Props) => { > {flexRender( header.column.columnDef.header, @@ -620,8 +626,15 @@ export const ConnectionTable = (props: Props) => { {header.column.getCanResize() && ( event.stopPropagation()} + onMouseDown={(event) => { + event.stopPropagation(); + header.getResizeHandler()(event); + }} + onTouchStart={(event) => { + event.stopPropagation(); + header.getResizeHandler()(event); + }} sx={{ cursor: "col-resize", position: "absolute",