@principal-ai/file-city-react 0.5.41 → 0.5.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,6 +54,13 @@ export function buildFolderIndex(cityData: CityData): FolderIndex {
54
54
  for (const d of cityData.districts) directorySet.add(d.path);
55
55
  const dirs = Array.from(directorySet).sort();
56
56
  for (const dir of dirs) {
57
+ // The empty path represents the synthetic project root that some city
58
+ // builders emit at depth 0. Including it here would register '' as its
59
+ // own parent (slash<0 → parent=''), which makes the recursive `walk`
60
+ // in `buildFolderElevatedPanels` loop forever the moment the root node
61
+ // is marked expanded. Top-level real folders already live under the
62
+ // empty-string parent, so skipping the empty entry costs nothing.
63
+ if (dir === '') continue;
57
64
  const slash = dir.lastIndexOf('/');
58
65
  const parent = slash >= 0 ? dir.slice(0, slash) : '';
59
66
  const arr = children.get(parent);