Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
Unify resize interaction feedback (#5779)
Naiyuan Qing7d6a1dfab175
diff --git a/packages/ui/components/ui/data-table.tsx b/packages/ui/components/ui/data-table.tsxindex b81b3e5707..17d7f222bd 100644--- a/packages/ui/components/ui/data-table.tsx+++ b/packages/ui/components/ui/data-table.tsx@@ -323,10 +323,10 @@ export function DataTable<TData>({tabIndex={0}className={cn("absolute top-0 right-0 h-full w-2 cursor-col-resize touch-none select-none outline-none",- "after:absolute after:top-1/2 after:right-0 after:h-4 after:w-px after:-translate-y-1/2 after:bg-border after:opacity-0 after:transition-opacity",- "hover:after:opacity-100 focus-visible:after:opacity-100",+ "after:absolute after:top-1/2 after:right-0 after:h-4 after:w-px after:-translate-y-1/2 after:bg-transparent after:transition-colors after:duration-100",+ "hover:after:bg-foreground/20 focus-visible:after:bg-foreground/20",resizingColumnId === header.column.id &&- "after:bg-primary after:opacity-100",+ "after:bg-foreground/40 after:transition-none",)}onPointerDown={(event) =>beginColumnResize(header, event)diff --git a/packages/ui/components/ui/resizable.tsx b/packages/ui/components/ui/resizable.tsxindex 305e07e6be..11ba39a190 100644--- a/packages/ui/components/ui/resizable.tsx+++ b/packages/ui/components/ui/resizable.tsx@@ -35,7 +35,7 @@ function ResizableHandle({<ResizablePrimitive.Separatordata-slot="resizable-handle"className={cn(- "relative flex w-0 items-center justify-center before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-transparent before:transition-colors hover:before:bg-foreground/15 data-[separator=active]:before:bg-foreground/15 after:absolute after:inset-y-0 after:left-1/2 after:w-2 after:-translate-x-1/2 focus-visible:outline-hidden aria-[orientation=horizontal]:h-0 aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:before:inset-x-0 aria-[orientation=horizontal]:before:inset-y-auto aria-[orientation=horizontal]:before:h-px aria-[orientation=horizontal]:before:w-full aria-[orientation=horizontal]:before:translate-x-0 aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-2 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2",+ "relative flex w-0 cursor-col-resize items-center justify-center before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-transparent before:transition-colors before:duration-100 hover:before:bg-foreground/20 data-[separator=active]:before:bg-foreground/40 data-[separator=active]:before:transition-none after:absolute after:inset-y-0 after:left-1/2 after:w-2 after:-translate-x-1/2 focus-visible:outline-hidden focus-visible:before:bg-foreground/20 aria-[orientation=horizontal]:h-0 aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:cursor-row-resize aria-[orientation=horizontal]:before:inset-x-0 aria-[orientation=horizontal]:before:inset-y-auto aria-[orientation=horizontal]:before:h-px aria-[orientation=horizontal]:before:w-full aria-[orientation=horizontal]:before:translate-x-0 aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-2 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2",className)}{...props}diff --git a/packages/ui/components/ui/sidebar.tsx b/packages/ui/components/ui/sidebar.tsxindex 3bdd0be3b4..4164e4e383 100644--- a/packages/ui/components/ui/sidebar.tsx+++ b/packages/ui/components/ui/sidebar.tsx@@ -454,7 +454,7 @@ function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {onPointerDown={onPointerDown}title={toggleLabel}className={cn(- "absolute inset-y-0 z-20 hidden w-4 touch-none cursor-ew-resize transition-[transform,background-color] ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",+ "absolute inset-y-0 z-20 hidden w-4 touch-none cursor-col-resize transition-[transform,background-color] ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-px after:bg-transparent after:transition-colors after:duration-100 hover:after:bg-foreground/20 sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",diff --git a/packages/ui/styles/base.css b/packages/ui/styles/base.cssindex 270a38a910..001cc7c357 100644--- a/packages/ui/styles/base.css+++ b/packages/ui/styles/base.css@@ -218,14 +218,31 @@color: var(--sidebar-accent-foreground);}-/* Sidebar resizing follows the same cursor contract as- * react-resizable-panels: the resize cursor survives leaving the narrow rail- * and wins over descendants with their own cursor declarations. Live width is- * written directly to the two layout shells, so their toggle transitions must- * stay disabled until the gesture finishes. */+/* Keep the active resize cursor stable after the pointer leaves a narrow+ * handle. Width and persistence remain owned by each existing implementation. */html[data-sidebar-resizing="true"],html[data-sidebar-resizing="true"] * {- cursor: ew-resize !important;+ cursor: col-resize !important;+ user-select: none !important;+}++html:has(+ [data-slot="resizable-handle"][data-separator="active"][aria-orientation="vertical"]+ ),+html:has(+ [data-slot="resizable-handle"][data-separator="active"][aria-orientation="vertical"]+ ) * {+ cursor: col-resize !important;+ user-select: none !important;+}++html:has(+ [data-slot="resizable-handle"][data-separator="active"][aria-orientation="horizontal"]+ ),+html:has(+ [data-slot="resizable-handle"][data-separator="active"][aria-orientation="horizontal"]+ ) * {+ cursor: row-resize !important;user-select: none !important;}@@ -235,7 +252,7 @@ html[data-sidebar-resizing="true"] * {}[data-sidebar-resizing="true"] [data-sidebar="rail"]::after {- background-color: var(--sidebar-border);+ background-color: color-mix(in oklab, var(--foreground) 40%, transparent);}/* Right detail sidebars use react-resizable-panels, which sizes panels bydiff --git a/packages/views/chat/components/chat-resize-handles.tsx b/packages/views/chat/components/chat-resize-handles.tsxindex df67b60c9f..37b9e1f925 100644--- a/packages/views/chat/components/chat-resize-handles.tsx+++ b/packages/views/chat/components/chat-resize-handles.tsx@@ -15,19 +15,19 @@ export function ChatResizeHandles({ onDragStart }: ChatResizeHandlesProps) {<divaria-hiddenonPointerDown={(e) => onDragStart(e, "left")}- className="absolute left-0 top-4 bottom-0 w-1 z-10 cursor-col-resize"+ className="absolute left-0 top-4 bottom-0 w-1 z-10 cursor-col-resize before:absolute before:inset-y-0 before:left-0 before:w-px before:bg-transparent before:transition-colors before:duration-100 hover:before:bg-foreground/20 active:before:bg-foreground/40 active:before:transition-none"/>{/* Top edge — expands height when dragged up */}<divaria-hiddenonPointerDown={(e) => onDragStart(e, "top")}- className="absolute top-0 left-4 right-0 h-1 z-10 cursor-row-resize"+ className="absolute top-0 left-4 right-0 h-1 z-10 cursor-row-resize before:absolute before:inset-x-0 before:top-0 before:h-px before:bg-transparent before:transition-colors before:duration-100 hover:before:bg-foreground/20 active:before:bg-foreground/40 active:before:transition-none"/>{/* Top-left corner — expands both width and height */}<divaria-hiddenonPointerDown={(e) => onDragStart(e, "corner")}- className="absolute top-0 left-0 size-4 z-20 cursor-nw-resize"+ className="absolute top-0 left-0 size-4 z-20 cursor-nw-resize before:absolute before:left-1 before:top-1 before:size-2 before:border-l before:border-t before:border-transparent before:transition-colors before:duration-100 hover:before:border-foreground/20 active:before:border-foreground/40 active:before:transition-none"/></>);diff --git a/packages/views/layout/sidebar-resize.test.tsx b/packages/views/layout/sidebar-resize.test.tsxindex 06796b4f6a..912e0c66b5 100644--- a/packages/views/layout/sidebar-resize.test.tsx+++ b/packages/views/layout/sidebar-resize.test.tsx@@ -70,7 +70,7 @@ describe("left sidebar resizing", () => {});expect(setPointerCapture).toHaveBeenCalledWith(7);- expect(rail).toHaveClass("cursor-ew-resize");+ expect(rail).toHaveClass("cursor-col-resize");expect(wrapper).toHaveAttribute("data-sidebar-resizing", "true");expect(document.documentElement).toHaveAttribute("data-sidebar-resizing", "true");