Skip to content

Commit dfea5b3

Browse files
juliusmarmingeclaude
authored andcommitted
fix(web): panel resize handles follow touch drags (pingdotgg#33066)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit fa2f4ff)
1 parent 4d67ecc commit dfea5b3

3 files changed

Lines changed: 17 additions & 23 deletions

File tree

‎apps/web/src/components/ThreadTerminalDrawer.tsx‎

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,6 +1790,17 @@ export default function ThreadTerminalDrawer({
17901790
};
17911791
}, [isPanel, visible]);
17921792

1793+
const resizeHandle = isPanel ? null : (
1794+
<div
1795+
className="absolute inset-x-0 top-0 z-20 h-1.5 cursor-row-resize touch-none any-pointer-coarse:h-4"
1796+
onPointerDown={handleResizePointerDown}
1797+
onPointerMove={handleResizePointerMove}
1798+
onPointerUp={handleResizePointerEnd}
1799+
onPointerCancel={handleResizePointerEnd}
1800+
onLostPointerCapture={handleResizePointerEnd}
1801+
/>
1802+
);
1803+
17931804
if (normalizedTerminalIds.length === 0) {
17941805
return (
17951806
<aside
@@ -1803,16 +1814,7 @@ export default function ThreadTerminalDrawer({
18031814
)}
18041815
style={isPanel ? undefined : { height: `var(${DRAG_HEIGHT_PROPERTY}, ${drawerHeight}px)` }}
18051816
>
1806-
{!isPanel ? (
1807-
<div
1808-
className="absolute inset-x-0 top-0 z-20 h-1.5 cursor-row-resize"
1809-
onPointerDown={handleResizePointerDown}
1810-
onPointerMove={handleResizePointerMove}
1811-
onPointerUp={handleResizePointerEnd}
1812-
onPointerCancel={handleResizePointerEnd}
1813-
onLostPointerCapture={handleResizePointerEnd}
1814-
/>
1815-
) : null}
1817+
{resizeHandle}
18161818
<div className="flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-4 py-6 text-center text-sm text-muted-foreground">
18171819
<p>No terminal sessions for this thread yet.</p>
18181820
<Button
@@ -1840,16 +1842,7 @@ export default function ThreadTerminalDrawer({
18401842
)}
18411843
style={isPanel ? undefined : { height: `var(${DRAG_HEIGHT_PROPERTY}, ${drawerHeight}px)` }}
18421844
>
1843-
{!isPanel ? (
1844-
<div
1845-
className="absolute inset-x-0 top-0 z-20 h-1.5 cursor-row-resize"
1846-
onPointerDown={handleResizePointerDown}
1847-
onPointerMove={handleResizePointerMove}
1848-
onPointerUp={handleResizePointerEnd}
1849-
onPointerCancel={handleResizePointerEnd}
1850-
onLostPointerCapture={handleResizePointerEnd}
1851-
/>
1852-
) : null}
1845+
{resizeHandle}
18531846

18541847
{!hasTerminalSidebar && (
18551848
<div className="pointer-events-none absolute right-2 top-2 z-20">
@@ -1929,7 +1922,8 @@ export default function ThreadTerminalDrawer({
19291922
{hasTerminalSidebar && (
19301923
<aside className="flex w-36 min-w-36 flex-col border border-border/70 bg-muted/10">
19311924
<div className="flex h-[22px] items-stretch justify-end border-b border-border/70">
1932-
<div className="inline-flex h-full items-stretch">
1925+
{/* Sits above the taller touch resize handle so its buttons keep their taps. */}
1926+
<div className="inline-flex h-full items-stretch any-pointer-coarse:relative any-pointer-coarse:z-30">
19331927
<TerminalActionButton
19341928
disabled={!canOperateTerminal}
19351929
className={`inline-flex h-full items-center px-1 text-foreground/90 transition-colors ${

‎apps/web/src/components/preview/RightPanelResizeHandle.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function RightPanelResizeHandle({ handlers, className, label, ...separato
1919
aria-orientation="vertical"
2020
{...separatorProps}
2121
className={cn(
22-
"group absolute inset-y-0 -left-1 z-20 w-2 cursor-col-resize select-none",
22+
"group absolute inset-y-0 -left-1 z-20 w-2 cursor-col-resize touch-none select-none any-pointer-coarse:-left-2 any-pointer-coarse:w-4",
2323
className,
2424
)}
2525
{...handlers}

‎apps/web/src/components/ui/sidebar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ function SidebarRail({
555555
/* A collapsed offcanvas rail overlaps the native scrollbar on Windows and Linux. */
556556
"-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=right]:left-0 sm:flex [[data-collapsible=offcanvas][data-state=collapsed]_&]:pointer-events-none",
557557
"[[data-panel-animations=true]_&]:transition-all [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out",
558-
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
558+
"touch-none in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
559559
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
560560
"group-data-[collapsible=offcanvas]:translate-x-0 hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:after:left-full",
561561
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",

0 commit comments

Comments
 (0)