Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
fix(web): prevent pinned threads reshuffling after drop (#7676)
Taras6d5c6c4a671c
diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsxindex 0c30a5b6b..a6dbb973e 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}/>,- <DndContext- key="pinned-dnd"- sensors={pinnedDndSensors}- collisionDetection={closestCenter}- modifiers={[restrictToVerticalAxis, restrictToFirstScrollableAncestor]}- onDragEnd={handlePinnedDragEnd}- >- <SortableContext- items={orderedPinnedThreads- .map((thread) =>- 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 (- <SortablePinnedThreadRow key={threadKey} id={threadKey}>- {(bag) => renderThreadRow(thread, "pinned", bag)}- </SortablePinnedThreadRow>- );- })}- </SortableContext>- </DndContext>,+ pinnedThreads.length > 0 ? (+ <li key="pinned-dnd" className="list-none">+ <DndContext+ sensors={pinnedDndSensors}+ collisionDetection={closestCenter}+ modifiers={[restrictToVerticalAxis, restrictToFirstScrollableAncestor]}+ onDragEnd={handlePinnedDragEnd}+ >+ <SortableContext+ items={orderedPinnedThreads+ .map((thread) =>+ scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id)),+ )+ .filter((threadKey) => reorderablePinnedKeys.has(threadKey))}+ strategy={verticalListSortingStrategy}+ >+ <ul+ role="list"+ aria-label="Pinned threads"+ className="flex flex-col gap-px"+ >+ {orderedPinnedThreads.map((thread) => {+ const threadKey = scopedThreadKey(+ scopeThreadRef(thread.environmentId, thread.id),+ );+ if (!reorderablePinnedKeys.has(threadKey)) {+ return renderThreadRow(thread, "pinned");+ }+ return (+ <SortablePinnedThreadRow key={threadKey} id={threadKey}>+ {(bag) => renderThreadRow(thread, "pinned", bag)}+ </SortablePinnedThreadRow>+ );+ })}+ </ul>+ </SortableContext>+ </DndContext>+ </li>+ ) : null,];if (pinnedThreads.length > 0) {items.push(