{#each breadcrumbs() as seg, i} {#if i > 0}/{/if} {#if i === breadcrumbs().length - 1} onBreadcrumbDragOver(e, seg.path)} ondragleave={onBreadcrumbDragLeave} ondrop={(e) => onBreadcrumbDrop(e, seg.path)}>{seg.name} {:else} {/if} {/each}
{#if workspacePorts.length > 0}
{$t('files.ports')} {#each workspacePorts as p (p.port)} {/each}
{/if}
{#if searchQuery} {/if}
{#if showNewInput}
{ if (e.key === 'Enter') confirmNew(); if (e.key === 'Escape') cancelNew(); }} autofocus />
{/if} {#if loading && initialLoad}
{:else if error}

{error}

{:else if visibleEntries.length === 0 && !showNewInput}

{searchQuery ? $t('files.noMatches') : $t('files.emptyDirectory')}

{:else} {#each visibleEntries as entry, i (entry.path)} {#if renamingEntry === entry.path}
{ if (e.key === 'Enter') confirmRename(entry.path); if (e.key === 'Escape') renamingEntry = null; }} onblur={() => confirmRename(entry.path)} autofocus />
{:else} {@const isSelected = selectedPaths.has(entry.path)} {@const isDragTarget = dragOverDir !== null && (entry.path === dragOverDir || entry.path.startsWith(dragOverDir + '/'))} {@const fileGitStatus = gitStatusForFile(entry)} {@const dirGitStatus = gitStatusForDirectory(entry)} {@const entryGitStatus = fileGitStatus ?? dirGitStatus} {@const entryGitDecoration = entryGitStatus ? gitStatusDecoration(entryGitStatus.status) : null} {/if} {/each} {/if}
{#if dropzoneActive}

{$t('files.dropToUpload')}

{/if} {#if selectedPaths.size > 0}
{$t('files.selected', { count: selectedPaths.size })}
{/if}
{#if sortMenuOpen && sortBtnEl} toggleSort('name') }, { label: $t('files.size'), icon: sortBy === 'size' ? (sortDir === 'asc' ? 'chevron-up' : 'chevron-down') : undefined, active: sortBy === 'size', onclick: () => toggleSort('size') }, { label: $t('files.date'), icon: sortBy === 'modified' ? (sortDir === 'asc' ? 'chevron-up' : 'chevron-down') : undefined, active: sortBy === 'modified', onclick: () => toggleSort('modified') } ]} onclose={() => (sortMenuOpen = false)} /> {/if} {#if addMenuOpen && addBtnEl} startNew('file') }, { label: $t('files.newFolder'), icon: 'folder', onclick: () => startNew('folder') }, { label: '', divider: true, onclick: () => {} }, { label: $t('files.uploadFile'), icon: 'upload', onclick: () => handleUploadFromMenu() }, { label: '', divider: true, onclick: () => {} }, { label: showHidden ? $t('files.hideHidden') : $t('files.showHidden'), icon: 'eye', onclick: () => toggleHidden() } ]} onclose={() => (addMenuOpen = false)} /> {/if} {#if directoryMenu} fetchDirectory(cwd) }, { label: '', divider: true, onclick: () => {} }, { label: $t('files.newFile'), icon: 'plus', onclick: () => startNew('file') }, { label: $t('files.newFolder'), icon: 'folder', onclick: () => startNew('folder') }, { label: $t('files.uploadFile'), icon: 'upload', onclick: () => handleUploadFromMenu() }, { label: '', divider: true, onclick: () => {} }, { label: showHidden ? $t('files.hideHidden') : $t('files.showHidden'), icon: 'eye', onclick: () => toggleHidden() } ]} onclose={closeDirectoryMenu} /> {/if} {#if contextMenu} { setFileBrowserCwd(contextMenu!.entry.path); closeMenu(); } }, { label: expandedDirs.has(contextMenu.entry.path) ? $t('files.collapse') : $t('files.expand'), icon: expandedDirs.has(contextMenu.entry.path) ? 'chevron-down' : 'chevron-right', onclick: () => { toggleDir(contextMenu!.entry.path); closeMenu(); } }, { label: '', divider: true, onclick: () => {} } ] : []), { label: $t('files.copyPath'), icon: 'copy', onclick: () => copyPath(contextMenu!.entry) }, { label: $t('files.rename'), icon: 'pencil', onclick: () => startRename(contextMenu!.entry) }, ...(contextMenu.entry.type !== 'directory' ? [ { label: $t('files.download'), icon: 'download', onclick: () => downloadEntry(contextMenu!.entry) } ] : []), { label: $t('files.delete'), icon: 'xmark', onclick: () => deleteEntry(contextMenu!.entry) } ]} onclose={closeMenu} /> {/if}