mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-17 04:15:05 +00:00
feat(vault): auto-expand first level folders in sidebar by default
This commit is contained in:
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(() => {
|
||||
|
||||
Reference in new issue
Block a user