Fix indent guide on drag and drop after expand folder

https://feedback.yaak.app/p/displace-moving-caret-on-spring-loaded-folder
This commit is contained in:
Gregory Schier
2025-10-25 09:41:06 -07:00
parent 17dbe7c9a7
commit 923b1ac830
5 changed files with 71 additions and 54 deletions
+10
View File
@@ -51,6 +51,16 @@ export const isParentHoveredFamily = atomFamily(
(a, b) => a.treeId === b.treeId && a.parentId === b.parentId,
);
export const isAncestorHoveredFamily = atomFamily(
({ treeId, ancestorIds }: { treeId: string; ancestorIds: string[] }) =>
selectAtom(
hoveredParentFamily(treeId),
(v) => v.parentId && ancestorIds.includes(v.parentId),
Object.is,
),
(a, b) => a.treeId === b.treeId && a.ancestorIds.join(',') === b.ancestorIds.join(','),
);
export const isIndexHoveredFamily = atomFamily(
({ treeId, index }: { treeId: string; index: number }) =>
selectAtom(hoveredParentFamily(treeId), (v) => v.index === index, Object.is),