Fix sidebar folder dragging collapse

https://feedback.yaak.app/p/a-folder-may-hide-its-content-if-i-move-a
This commit is contained in:
Gregory Schier
2025-06-29 08:02:55 -07:00
parent d3cda19be2
commit 99975c3223
3 changed files with 4 additions and 4 deletions

View File

@@ -232,6 +232,7 @@ export function Sidebar({ className }: Props) {
const handleEnd = useCallback<SidebarItemProps['onEnd']>(
async (itemId) => {
setHoveredTree(null);
setDraggingId(null);
handleClearSelected();
if (hoveredTree == null || hoveredIndex == null) {
@@ -278,9 +279,8 @@ export function Sidebar({ className }: Props) {
);
} else {
const sortPriority = afterPriority - (afterPriority - beforePriority) / 2;
return patchModelById(child.model, child.id, { sortPriority, folderId });
await patchModelById(child.model, child.id, { sortPriority, folderId });
}
setDraggingId(null);
},
[handleClearSelected, hoveredTree, hoveredIndex, treeParentMap],
);

View File

@@ -6,7 +6,7 @@ import {
type WebsocketRequest,
} from '@yaakapp-internal/models';
// This is an atom so we can use it in the child items to avoid re-rendering the entire list
// This is an atom, so we can use it in the child items to avoid re-rendering the entire list
import { atom } from 'jotai';
import { activeWorkspaceAtom } from '../../hooks/useActiveWorkspace';
import { allRequestsAtom } from '../../hooks/useAllRequests';