Library
{#each visibleTabIds as id, idx} {@const cat = visibleCategories.find(c => String(c.id) === id)} {#if id === "library" || id === "downloaded" || cat} {@const isBuiltin = id === "library" || id === "downloaded"} {@const isCompleted = cat && id === String(completedCatId)} {@const isDraggable = true} {#if activeDragKind === "tab" && dragInsertIdx === idx}
{/if}
onTabChange(id)} ondragstart={isDraggable ? (e) => onTabDragStart(e, id) : undefined} ondragover={isDraggable ? (e) => onTabDragOver(e, id, idx) : undefined} ondragleave={isDraggable ? onTabDragLeave : undefined} ondrop={isDraggable ? (e) => onTabDrop(e, id) : undefined} ondragend={isDraggable ? onTabDragEnd : undefined} > {#if id === "library"}
{:else if id === "downloaded"}
{:else if cat && id === String(completedCatId)}
{:else if cat}
{/if} {id === "library" ? "Saved" : id === "downloaded" ? "Downloaded" : (cat?.name ?? id)}
{counts[id] ?? 0}
{#if activeDragKind === "tab" && dragInsertIdx === idx + 1}
{/if} {/if} {/each}
onSearchChange((e.target as HTMLInputElement).value)} />
{#if refreshing}
{#if refreshProgress.total > 0}
{refreshProgress.finished}/{refreshProgress.total}
{/if}
{:else}
{/if}
{#if sortPanelOpen}
Sort
Order by
{#each ALL_SORT_MODES as m}
onSortChange(m)} > {SORT_LABELS[m]} {#if tabSortMode === m} {#if tabSortDir === "asc"}
{:else}
{/if} {/if}
{/each}
{tabSortDir === "asc" ? "Ascending" : "Descending"} {#if tabSortDir === "asc"}
{:else}
{/if}
{/if}