{#if !isRunning}
File browser is only available for running capsules.
{:else}
(pathInputFocused = true)} onblur={() => (pathInputFocused = false)} onkeydown={handleKeydown} placeholder="/path/to/file" spellcheck="false" autocomplete="off" class="flex-1 bg-transparent font-mono text-meta text-[var(--color-text-primary)] outline-none placeholder:text-[var(--color-text-muted)]" />
Go
{#each breadcrumbs() as crumb, i} {#if i > 0}
{/if}
navigateTo(crumb.path)} class="shrink-0 rounded-[3px] px-1.5 py-0.5 font-mono text-label text-[var(--color-text-secondary)] transition-colors hover:bg-[var(--color-bg-4)] hover:text-[var(--color-text-primary)] {i === breadcrumbs().length - 1 ? 'text-[var(--color-text-primary)]' : ''}" > {crumb.name}
{/each}
{#if dirLoading}
Loading...
{:else if dirError}
{dirError}
{:else if entries.length === 0}
Empty directory
{:else} {#if currentPath !== '/'}
navigateTo(currentPath + '/..')} class="file-row flex w-full items-center gap-3 px-4 py-2 text-left" >
..
{/if} {#each sortedEntries as entry (entry.path)}
selectFile(entry)} class="file-row flex w-full items-center gap-3 px-4 py-[7px] text-left {selectedFile?.path === entry.path ? 'active' : ''}" > {#if fileIcon(entry) === 'dir'}
{:else if fileIcon(entry) === 'link'}
{:else}
{/if}
{entry.name}
{#if entry.type === 'symlink' && entry.symlink_target}
→ {entry.symlink_target}
{/if}
{#if entry.type === 'file'}
{formatFileSize(entry.size)}
{/if}
{entry.permissions}
{/each} {/if}
{#if !dirLoading && !dirError}
{entries.length} item{entries.length !== 1 ? 's' : ''}
{/if}
{#if !selectedFile}
Select a file to preview
{:else}
{selectedFile.path}
{formatFileSize(selectedFile.size)}
Download
{#if fileLoading}
Reading file...
{:else if fileError}
{fileError}
{:else if isBinaryFile(selectedFile.name) || isFileTooLarge(selectedFile.size) || (selectedFile && fileContent === null && !fileLoading)}
{#if isFileTooLarge(selectedFile.size)}
{:else}
{/if}
{#if isFileTooLarge(selectedFile.size)}
File too large to preview
{formatFileSize(selectedFile.size)} exceeds the 10 MB preview limit
{:else}
Binary file
This file cannot be displayed as text
{/if}
Download file
{:else if fileContent !== null}
{#each fileContent.split('\n') as line, i}
{i + 1}
{line}
{/each}
{/if}
{/if}
{/if}