MCPcopy Create free account
hub / github.com/altic-dev/Pilot / toggleDirectory

Function toggleDirectory

src/components/file-browser.tsx:59–71  ·  view source on GitHub ↗
(dirPath: string)

Source from the content-addressed store, hash-verified

57 };
58
59 const toggleDirectory = async (dirPath: string) => {
60 const newExpanded = new Set(expandedDirs);
61
62 if (expandedDirs.has(dirPath)) {
63 newExpanded.delete(dirPath);
64 } else {
65 newExpanded.add(dirPath);
66 // Load directory contents if not already loaded
67 await loadDirectory(dirPath);
68 }
69
70 setExpandedDirs(newExpanded);
71 };
72
73 const selectFile = async (filePath: string) => {
74 setSelectedFile(filePath);

Callers 1

renderTreeFunction · 0.85

Calls 1

loadDirectoryFunction · 0.85

Tested by

no test coverage detected