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

View File

@@ -1,19 +1,19 @@
import classNames from 'classnames';
import { useAtomValue } from 'jotai';
import { memo } from 'react';
import { hoveredParentDepthFamily, isParentHoveredFamily } from './atoms';
import { hoveredParentDepthFamily, isAncestorHoveredFamily } from './atoms';
export const TreeIndentGuide = memo(function TreeIndentGuide({
treeId,
depth,
parentId,
ancestorIds,
}: {
treeId: string;
depth: number;
parentId: string | null;
ancestorIds: string[];
}) {
const parentDepth = useAtomValue(hoveredParentDepthFamily(treeId));
const isHovered = useAtomValue(isParentHoveredFamily({ treeId, parentId }));
const isHovered = useAtomValue(isAncestorHoveredFamily({ treeId, ancestorIds }));
return (
<div className="flex">