{#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)} {/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 contextMenu} 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}