!isSearching && onDropzoneOver(e)} ondragleave={(e) => !isSearching && onDropzoneLeave(e)} ondrop={(e) => !isSearching && onDropzoneDrop(e)} >
{#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 !isSearching} {/if}
{#if workspacePorts.length > 0}
{$t('files.ports')} {#each workspacePorts as p (p.port)} {/each}
{/if}
{#if searchQuery} {/if}
!isSearching && onDirectoryContextMenu(e)} > {#if showNewInput && !isSearching}
{ if (e.key === 'Enter') confirmNew(); if (e.key === 'Escape') cancelNew(); }} autofocus />
{/if} {#if loading && initialLoad}
{:else if error}

{error}

{:else if isSearching} {#if matchLoading}
{:else if matchError}

{matchError}

{:else if !matchResults?.length}

{$t('files.noMatches')}

{:else} {#snippet resultRows(matches: FileMatch[])} {#each matches as match (match.path)} {#if match.content_matches.length > 0} {@const preview = match.content_matches[0]} {/if} {/each} {/snippet} {#if filenameMatches.length > 0}
{$t('files.filenameMatches')}
{@render resultRows(filenameMatches)} {/if} {#if contentOnlyMatches.length > 0}
{$t('files.contentMatches')}
{@render resultRows(contentOnlyMatches)} {/if} {#if nextMatchOffset !== null}
{#if matchLoadingMore} {:else if matchLoadMoreError} {/if}
{/if} {/if} {: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 && !isSearching}

{$t('files.dropToUpload')}

{/if} {#if selectedPaths.size > 0 && !isSearching}
{$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}