Skip to content
TypeScript

fix(web): dragging a sidebar thread no longer scrolls the list out from under the pointer (#30346)

Julius Marminge37481f044e74
diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx
index a82da0bf5f4..1ed3065a92c 100644
--- a/apps/web/src/components/Sidebar.tsx
+++ b/apps/web/src/components/Sidebar.tsx
@@ -3297,6 +3297,10 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
"relative flex flex-col gap-px",
sidebarListItems.length > 0 && "flex-1",
actionSweep !== null && "**:pointer-events-none",
+ // Projected rows (two boundary labels, two hints) extend the scroll range; a range that
+ // shrinks as the target changes clamps scrollTop and flips the target under a still pointer.
+ dragState !== null &&
+ "after:pointer-events-none after:absolute after:inset-x-0 after:-bottom-30 after:h-px after:content-['']",
)}
>
{(() => {
diff --git a/apps/web/src/components/sidebar/SidebarListMarkers.tsx b/apps/web/src/components/sidebar/SidebarListMarkers.tsx
index 3416d80ff5e..da9444a5c1b 100644
--- a/apps/web/src/components/sidebar/SidebarListMarkers.tsx
+++ b/apps/web/src/components/sidebar/SidebarListMarkers.tsx
@@ -56,7 +56,10 @@ export function SidebarSectionPlaceholder(props: {
marker={props.marker}
data-testid={`sidebar-${props.marker}`}
className="relative mx-0.5 -mb-px h-0"
- revealOverflow={props.marker === "settled-placeholder" && props.showHint}
+ // Revealing on every drag scrolls the list out from under the pointer.
+ revealOverflow={
+ props.marker === "settled-placeholder" && props.showHint && props.isDropTarget
+ }
>
{props.showHint ? (
<div