From 6d5c6c4a671c7b6fc9723c63c1003916fb3b8ab0 Mon Sep 17 00:00:00 2001 From: Taras Date: Fri, 21 Aug 2026 08:08:33 +0300 Subject: [PATCH] fix(web): prevent pinned threads reshuffling after drop (#7676) --- apps/web/src/components/Sidebar.tsx | 69 ++++++++++++++++------------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 0c30a5b6b55e3646c56608bd207ab832901c91cd..a6dbb973e5e395a73d66aca23611bd3912d4dd88 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -3746,36 +3746,45 @@ export default function Sidebar() { routeDraftId={routeDraftIdForRows} onNavigateToDraft={navigateToDraft} />, - - - scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id)), - ) - .filter((threadKey) => reorderablePinnedKeys.has(threadKey))} - strategy={verticalListSortingStrategy} - > - {orderedPinnedThreads.map((thread) => { - const threadKey = scopedThreadKey( - scopeThreadRef(thread.environmentId, thread.id), - ); - if (!reorderablePinnedKeys.has(threadKey)) { - return renderThreadRow(thread, "pinned"); - } - return ( - - {(bag) => renderThreadRow(thread, "pinned", bag)} - - ); - })} - - , + pinnedThreads.length > 0 ? ( +
  • + + + scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id)), + ) + .filter((threadKey) => reorderablePinnedKeys.has(threadKey))} + strategy={verticalListSortingStrategy} + > +
      + {orderedPinnedThreads.map((thread) => { + const threadKey = scopedThreadKey( + scopeThreadRef(thread.environmentId, thread.id), + ); + if (!reorderablePinnedKeys.has(threadKey)) { + return renderThreadRow(thread, "pinned"); + } + return ( + + {(bag) => renderThreadRow(thread, "pinned", bag)} + + ); + })} +
    +
    +
    +
  • + ) : null, ]; if (pinnedThreads.length > 0) { items.push( -- 2.54.0