Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai a2a58d13b8 fix(ui): show a resize cursor on splitters under WebKit on macOS 26.2
WebKit on macOS 26.2 renders ew-resize and ns-resize as the default arrow,
so panel dividers, editor splits, side tab, column and diff resizers gave no
hover feedback. Dividers now use col-resize / row-resize, which that WebKit
still draws, also while a drag holds the cursor.
2026-11-18 22:21:09 +08:00
15 змінених файлів з 30 додано та 29 видалено

No files matched your search

+1 -1
Переглянути файл
@@ -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);
+1 -1
Переглянути файл
@@ -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) => {
+1 -1
Переглянути файл
@@ -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) => {
+1 -1
Переглянути файл
@@ -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);
+1 -1
Переглянути файл
@@ -67,7 +67,7 @@
right: -3px;
width: 6px;
height: 100%;
cursor: ew-resize;
cursor: col-resize;
}
.rowNumber {
display: flex;
+1 -1
Переглянути файл
@@ -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) => {
+1 -1
Переглянути файл
@@ -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) {
+1 -1
Переглянути файл
@@ -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;
+1 -1
Переглянути файл
@@ -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);
+1 -1
Переглянути файл
@@ -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" },
+3 -2
Переглянути файл
@@ -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: "";
+6 -6
Переглянути файл
@@ -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("");
+1 -1
Переглянути файл
@@ -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;
+6 -6
Переглянути файл
@@ -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: "";
+4 -4
Переглянути файл
@@ -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();