@foreach ($nodes as $node) @php $isDir = ($node['type'] ?? '') === 'dir'; $path = $node['path'] ?? ''; $name = $node['name'] ?? ''; $isOpen = $isDir && $currentPath && str_starts_with($currentPath, rtrim($path, '/') . '/'); if ($isDir && !$currentPath && $path === 'grading_results') { $isOpen = false; } elseif ($isDir && !$currentPath) { $isOpen = true; } $searchText = strtolower($path . ' ' . $name); $deletable = !empty($node['deletable']); @endphp