From 9a0256c7d4e7c19dce90a9e42c091a7f23e3b8c0 Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Wed, 18 Nov 2026 22:21:24 +0800 Subject: [PATCH] fix(ui): show a resize cursor on splitters under WebKit on macOS 26.2 (#4334) WebKit on macOS 26.2 renders ew-resize/ns-resize as the default arrow, so dividers gave no hover feedback. Dividers (tool window gaps and splits, editor splits, side tabs, diff gutter, column resizers, review handles) and the drag-time cursor lock now use col-resize/row-resize. Window and popup edge handles are unchanged. --- src/editor/core/view/EditorArea.module.css | 2 +- src/editor/core/view/SideTabsResizer.tsx | 2 +- src/features/agents/ChangesResizer.tsx | 2 +- src/features/agents/Session.module.css | 2 +- src/features/database/Database.module.css | 2 +- src/features/database/Grid.tsx | 2 +- src/features/vcs/DiffEditor.module.css | 2 +- src/features/vcs/GitLog.module.css | 2 +- src/features/vcs/log/useColumnResize.ts | 2 +- src/features/vcs/reviewGutter.ts | 2 +- src/ui/Splitter.module.css | 5 +++-- src/ui/dragCursor.test.ts | 12 ++++++------ src/ui/dragCursor.ts | 2 +- src/workbench/toolwindows/ToolWindows.module.css | 12 ++++++------ src/workbench/toolwindows/ToolWindows.tsx | 8 ++++---- 15 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/editor/core/view/EditorArea.module.css b/src/editor/core/view/EditorArea.module.css index 166d0a435..1e3435bef 100644 --- a/src/editor/core/view/EditorArea.module.css +++ b/src/editor/core/view/EditorArea.module.css @@ -308,7 +308,7 @@ content: ""; position: absolute; inset: 0 -3px; - cursor: ew-resize; + cursor: col-resize; } .sideTabsResizer:focus-visible::after { background: color-mix(in srgb, var(--focus-ring) 55%, transparent); diff --git a/src/editor/core/view/SideTabsResizer.tsx b/src/editor/core/view/SideTabsResizer.tsx index 4f2d4df31..c2046cf15 100644 --- a/src/editor/core/view/SideTabsResizer.tsx +++ b/src/editor/core/view/SideTabsResizer.tsx @@ -62,7 +62,7 @@ export function SideTabsResizer({ side }: { side: "left" | "right" }) { handle.setPointerCapture(e.pointerId); const origin = e.clientX; const previous = pane.style.getPropertyValue(LIMIT_VAR); - const releaseCursor = lockDragCursor("ew-resize"); + const releaseCursor = lockDragCursor("col-resize"); let next: number | null = null; // Only this pane follows the pointer; every group takes the new width on release. const move = (ev: globalThis.PointerEvent) => { diff --git a/src/features/agents/ChangesResizer.tsx b/src/features/agents/ChangesResizer.tsx index 057479c19..d22be1c49 100644 --- a/src/features/agents/ChangesResizer.tsx +++ b/src/features/agents/ChangesResizer.tsx @@ -38,7 +38,7 @@ export function ChangesResizer() { const start = pane.getBoundingClientRect().width; const origin = e.clientX; const previous = session.style.getPropertyValue(WIDTH_VAR); - const releaseCursor = lockDragCursor("ew-resize"); + const releaseCursor = lockDragCursor("col-resize"); let next: number | null = null; // Only this session follows the pointer; every task takes the new width on release. const move = (ev: globalThis.PointerEvent) => { diff --git a/src/features/agents/Session.module.css b/src/features/agents/Session.module.css index b6e431fea..ac4627b19 100644 --- a/src/features/agents/Session.module.css +++ b/src/features/agents/Session.module.css @@ -1253,7 +1253,7 @@ content: ""; position: absolute; inset: 0 -3px; - cursor: ew-resize; + cursor: col-resize; } .changesResizer:focus-visible::after { background: color-mix(in srgb, var(--focus-ring) 55%, transparent); diff --git a/src/features/database/Database.module.css b/src/features/database/Database.module.css index e0604824d..aab7c068e 100644 --- a/src/features/database/Database.module.css +++ b/src/features/database/Database.module.css @@ -67,7 +67,7 @@ right: -3px; width: 6px; height: 100%; - cursor: ew-resize; + cursor: col-resize; } .rowNumber { display: flex; diff --git a/src/features/database/Grid.tsx b/src/features/database/Grid.tsx index bb0e91781..900eb9f62 100644 --- a/src/features/database/Grid.tsx +++ b/src/features/database/Grid.tsx @@ -574,7 +574,7 @@ export function Grid(props: GridProps) { const startResize = (e: MouseEvent, col: number) => { e.preventDefault(); e.stopPropagation(); - const releaseCursor = lockDragCursor("ew-resize"); + const releaseCursor = lockDragCursor("col-resize"); const startX = e.clientX; const start = widths[col] ?? 100; const move = (ev: globalThis.MouseEvent) => { diff --git a/src/features/vcs/DiffEditor.module.css b/src/features/vcs/DiffEditor.module.css index a0a549401..329220f49 100644 --- a/src/features/vcs/DiffEditor.module.css +++ b/src/features/vcs/DiffEditor.module.css @@ -252,7 +252,7 @@ background: var(--bg-app); border-left: 1px solid var(--border); border-right: 1px solid var(--border); - cursor: ew-resize; + cursor: col-resize; touch-action: none; } .host :global(.cm-diffDivider:hover) { diff --git a/src/features/vcs/GitLog.module.css b/src/features/vcs/GitLog.module.css index 7bd251bd5..7dba08e7e 100644 --- a/src/features/vcs/GitLog.module.css +++ b/src/features/vcs/GitLog.module.css @@ -234,7 +234,7 @@ overflow:hidden, so any rule drawn into the 8px gap would be clipped away. */ inset-inline-start: -4px; width: 8px; - cursor: ew-resize; + cursor: col-resize; touch-action: none; z-index: 1; display: flex; diff --git a/src/features/vcs/log/useColumnResize.ts b/src/features/vcs/log/useColumnResize.ts index fed1aa88a..56a2cc572 100644 --- a/src/features/vcs/log/useColumnResize.ts +++ b/src/features/vcs/log/useColumnResize.ts @@ -120,7 +120,7 @@ export function useColumnResize(target: ResizeTarget) { x: e.clientX, element: e.currentTarget, pointerId: e.pointerId, - releaseCursor: lockDragCursor("ew-resize"), + releaseCursor: lockDragCursor("col-resize"), }; listeners.current = { blur, escape }; e.currentTarget.setPointerCapture?.(e.pointerId); diff --git a/src/features/vcs/reviewGutter.ts b/src/features/vcs/reviewGutter.ts index 7f8c38a80..1dc8ef33a 100644 --- a/src/features/vcs/reviewGutter.ts +++ b/src/features/vcs/reviewGutter.ts @@ -352,7 +352,7 @@ const theme = EditorView.baseTheme({ height: "4px", borderRadius: "2px", background: "var(--focus-ring, #3574f0)", - cursor: "ns-resize", + cursor: "row-resize", }, ".cm-reviewHandle[data-disabled]": { opacity: "0.4", cursor: "default" }, ".cm-reviewHandle-start": { top: "-2px" }, diff --git a/src/ui/Splitter.module.css b/src/ui/Splitter.module.css index 130a47f03..afd29dda1 100644 --- a/src/ui/Splitter.module.css +++ b/src/ui/Splitter.module.css @@ -16,13 +16,14 @@ outline: none; transition: background var(--dur) var(--ease); } +/* Dividers use col-/row-resize: WebKit on macOS 26.2 shows the arrow for ew-/ns-resize. */ .handle[aria-orientation="vertical"] { width: 1px; - cursor: ew-resize; + cursor: col-resize; } .handle[aria-orientation="horizontal"] { height: 1px; - cursor: ns-resize; + cursor: row-resize; } .handle::after { content: ""; diff --git a/src/ui/dragCursor.test.ts b/src/ui/dragCursor.test.ts index f326a04f5..8362f29fa 100644 --- a/src/ui/dragCursor.test.ts +++ b/src/ui/dragCursor.test.ts @@ -10,9 +10,9 @@ afterEach(() => { describe("lockDragCursor", () => { it("holds the cursor until the drag ends", () => { - const release = lockDragCursor("ew-resize"); + const release = lockDragCursor("col-resize"); expect(html.getAttribute("data-drag-cursor")).toBe(""); - expect(html.style.getPropertyValue("--drag-cursor")).toBe("ew-resize"); + expect(html.style.getPropertyValue("--drag-cursor")).toBe("col-resize"); release(); expect(html.hasAttribute("data-drag-cursor")).toBe(false); @@ -20,27 +20,27 @@ describe("lockDragCursor", () => { }); it("ignores a repeated release", () => { - const release = lockDragCursor("ns-resize"); + const release = lockDragCursor("row-resize"); release(); release(); expect(html.hasAttribute("data-drag-cursor")).toBe(false); }); it("restores an outer drag after a nested one ends", () => { - const outer = lockDragCursor("ew-resize"); + const outer = lockDragCursor("col-resize"); const inner = lockDragCursor("nwse-resize"); expect(html.style.getPropertyValue("--drag-cursor")).toBe("nwse-resize"); inner(); expect(html.getAttribute("data-drag-cursor")).toBe(""); - expect(html.style.getPropertyValue("--drag-cursor")).toBe("ew-resize"); + expect(html.style.getPropertyValue("--drag-cursor")).toBe("col-resize"); outer(); expect(html.hasAttribute("data-drag-cursor")).toBe(false); }); it("releases when the pointer goes up outside the handle", () => { - lockDragCursor("ew-resize"); + lockDragCursor("col-resize"); document.dispatchEvent(new Event("pointerup", { bubbles: true })); expect(html.hasAttribute("data-drag-cursor")).toBe(false); expect(html.style.getPropertyValue("--drag-cursor")).toBe(""); diff --git a/src/ui/dragCursor.ts b/src/ui/dragCursor.ts index da97572f4..87db909de 100644 --- a/src/ui/dragCursor.ts +++ b/src/ui/dragCursor.ts @@ -7,7 +7,7 @@ * default one mid-drag. `global.css` keys off `data-drag-cursor` instead and * wins over those cursors with `!important`. */ -export type DragCursor = "ew-resize" | "ns-resize" | "nwse-resize"; +export type DragCursor = "col-resize" | "row-resize" | "ew-resize" | "ns-resize" | "nwse-resize"; const active = new Set<() => void>(); let listening = false; diff --git a/src/workbench/toolwindows/ToolWindows.module.css b/src/workbench/toolwindows/ToolWindows.module.css index 515febb6a..7804ce249 100644 --- a/src/workbench/toolwindows/ToolWindows.module.css +++ b/src/workbench/toolwindows/ToolWindows.module.css @@ -179,17 +179,17 @@ .undocked[data-slot^="left"] > .undockEdge { inset: 0 0 0 auto; width: var(--island-gap); - cursor: ew-resize; + cursor: col-resize; } .undocked[data-slot^="right"] > .undockEdge { inset: 0 auto 0 0; width: var(--island-gap); - cursor: ew-resize; + cursor: col-resize; } .undocked[data-slot^="bottom"] > .undockEdge { inset: 0 0 auto; height: var(--island-gap); - cursor: ns-resize; + cursor: row-resize; } .undockEdge:focus-visible { background: color-mix(in srgb, var(--accent) 45%, transparent); @@ -210,10 +210,10 @@ grid-area: gap-bottom; } .gap[aria-orientation="vertical"] { - cursor: ew-resize; + cursor: col-resize; } .gap[aria-orientation="horizontal"] { - cursor: ns-resize; + cursor: row-resize; } /* A slightly wider hit area than the gap itself. */ .gap::before { @@ -286,7 +286,7 @@ flex: none; width: 0; outline: none; - cursor: ew-resize; + cursor: col-resize; } .stripeHandle::before { content: ""; diff --git a/src/workbench/toolwindows/ToolWindows.tsx b/src/workbench/toolwindows/ToolWindows.tsx index 74e414b0f..c808bdff2 100644 --- a/src/workbench/toolwindows/ToolWindows.tsx +++ b/src/workbench/toolwindows/ToolWindows.tsx @@ -269,7 +269,7 @@ function StripeHandle({ const origin = e.clientX; const icons = parseFloat(getComputedStyle(stripe).getPropertyValue("--stripe-icon-button")) || 30; const start = names ? width : icons; - const releaseCursor = lockDragCursor("ew-resize"); + const releaseCursor = lockDragCursor("col-resize"); let next = { names, width, px: start }; const move = (ev: globalThis.PointerEvent) => { if (!(ev.buttons & 1)) return end(); @@ -945,7 +945,7 @@ function SplitHandle({ anchor, hidden }: { anchor: ToolWindowAnchor; hidden: boo e.preventDefault(); el.setPointerCapture(e.pointerId); const origin = stacked ? e.clientY : e.clientX; - const releaseCursor = lockDragCursor(stacked ? "ns-resize" : "ew-resize"); + const releaseCursor = lockDragCursor(stacked ? "row-resize" : "col-resize"); let ratio: number | null = null; const move = (ev: globalThis.PointerEvent) => { if (!(ev.buttons & 1)) return end(); @@ -1018,7 +1018,7 @@ function UndockEdge({ anchor }: { anchor: ToolWindowAnchor }) { e.preventDefault(); el.setPointerCapture(e.pointerId); const origin = vertical ? e.clientX : e.clientY; - const releaseCursor = lockDragCursor(vertical ? "ew-resize" : "ns-resize"); + const releaseCursor = lockDragCursor(vertical ? "col-resize" : "row-resize"); let next = m.size; const move = (ev: globalThis.PointerEvent) => { if (!(ev.buttons & 1)) return end(); @@ -1201,7 +1201,7 @@ function GapHandle({ const el = e.currentTarget; el.setPointerCapture(e.pointerId); const origin = vertical ? e.clientX : e.clientY; - const releaseCursor = lockDragCursor(vertical ? "ew-resize" : "ns-resize"); + const releaseCursor = lockDragCursor(vertical ? "col-resize" : "row-resize"); let next = m.size; const move = (ev: globalThis.PointerEvent) => { if (!(ev.buttons & 1)) return end();