feat(vault): auto-expand first level folders in sidebar by default

This commit is contained in:
viettranx committed 2026-04-12 18:17:19 +07:00
1 parent 1808523f3f
commit 9538886175
1 file changed
+2 -1
@@ -48,7 +48,8 @@ function VaultTreeNode({
node: TreeNode; depth: number; meta: Map<string, VaultTreeEntry>;
activePath: string | null; onSelect: (path: string) => void; onLoadMore: (path: string) => void;
}) {
const [expanded, setExpanded] = useState(false);
// Auto-expand first level folders (depth=0) by default
const [expanded, setExpanded] = useState(depth === 0 && node.isDir);
const entry = meta.get(node.path);
const handleToggle = useCallback(() => {