authorgravatar for Taras.Fomin@gmail.comTaras <Taras.Fomin@gmail.com> 2026-08-21 08:08:33+03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-08-20 22:08:33-07:00
log6d5c6c4a671c7b6fc9723c63c1003916fb3b8ab0
tree49a2d467971d68bc73cbd9053bb4f9a270693965
parent20e5a3396858f93157a4ad6b1f3a2f565c032fee
signature Signed by PGP key B5690EEEBB952194

fix(web): prevent pinned threads reshuffling after drop (#7676)


1 files changed, 39 insertions(+), 30 deletions(-)

apps/web/src/components/Sidebar.tsx+39-30
...@@ -3746,36 +3746,45 @@ export default function Sidebar() {...@@ -3746,36 +3746,45 @@ export default function Sidebar() {
3746 routeDraftId={routeDraftIdForRows}3746 routeDraftId={routeDraftIdForRows}
3747 onNavigateToDraft={navigateToDraft}3747 onNavigateToDraft={navigateToDraft}
3748 />,3748 />,
3749 <DndContext3749 pinnedThreads.length > 0 ? (
3750 key="pinned-dnd"3750 <li key="pinned-dnd" className="list-none">
3751 sensors={pinnedDndSensors}3751 <DndContext
3752 collisionDetection={closestCenter}3752 sensors={pinnedDndSensors}
3753 modifiers={[restrictToVerticalAxis, restrictToFirstScrollableAncestor]}3753 collisionDetection={closestCenter}
3754 onDragEnd={handlePinnedDragEnd}3754 modifiers={[restrictToVerticalAxis, restrictToFirstScrollableAncestor]}
3755 >3755 onDragEnd={handlePinnedDragEnd}
3756 <SortableContext3756 >
3757 items={orderedPinnedThreads3757 <SortableContext
3758 .map((thread) =>3758 items={orderedPinnedThreads
3759 scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id)),3759 .map((thread) =>
3760 )3760 scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id)),
3761 .filter((threadKey) => reorderablePinnedKeys.has(threadKey))}3761 )
3762 strategy={verticalListSortingStrategy}3762 .filter((threadKey) => reorderablePinnedKeys.has(threadKey))}
3763 >3763 strategy={verticalListSortingStrategy}
3764 {orderedPinnedThreads.map((thread) => {3764 >
3765 const threadKey = scopedThreadKey(3765 <ul
3766 scopeThreadRef(thread.environmentId, thread.id),3766 role="list"
3767 );3767 aria-label="Pinned threads"
3768 if (!reorderablePinnedKeys.has(threadKey)) {3768 className="flex flex-col gap-px"
3769 return renderThreadRow(thread, "pinned");3769 >
3770 }3770 {orderedPinnedThreads.map((thread) => {
3771 return (3771 const threadKey = scopedThreadKey(
3772 <SortablePinnedThreadRow key={threadKey} id={threadKey}>3772 scopeThreadRef(thread.environmentId, thread.id),
3773 {(bag) => renderThreadRow(thread, "pinned", bag)}3773 );
3774 </SortablePinnedThreadRow>3774 if (!reorderablePinnedKeys.has(threadKey)) {
3775 );3775 return renderThreadRow(thread, "pinned");
3776 })}3776 }
3777 </SortableContext>3777 return (
3778 </DndContext>,3778 <SortablePinnedThreadRow key={threadKey} id={threadKey}>
3779 {(bag) => renderThreadRow(thread, "pinned", bag)}
3780 </SortablePinnedThreadRow>
3781 );
3782 })}
3783 </ul>
3784 </SortableContext>
3785 </DndContext>
3786 </li>
3787 ) : null,
3779 ];3788 ];
3780 if (pinnedThreads.length > 0) {3789 if (pinnedThreads.length > 0) {
3781 items.push(3790 items.push(