History
{history.length} saved
{#if history.length > 0}
Clear All
{/if}
{#if searchQuery}
{filtered.length} results
searchQuery = ""} >Clear
{/if}
{#if filtered.length === 0}
{:else}
{#each visibleItems as { item, top, height, preview } (item.id)}
toggleExpand(item.id)} onkeydown={(e) => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); toggleExpand(item.id); } }} role="button" tabindex="0" aria-expanded={expandedId === item.id} > {#if item.audioPath}
{ e.stopPropagation(); togglePlay(item); }} aria-label={playingId === item.id && audioEl && !audioEl.paused ? "Pause" : "Play"} > {#if playingId === item.id && audioEl && !audioEl.paused}
{:else}
{/if}
{:else}
{/if}
{preview?.text || compactPreviewText(item)}
{#if item.duration}
{formatDuration(item.duration)}
{/if}
{#if item.source && item.source.toLowerCase().includes("file")}
{:else}
{/if}
{item.date}
{#if expandedId === item.id}
{#if item.audioPath && playingId === item.id}
{formatTime(currentTime)} / {formatTime(duration)}
e.stopPropagation()} />
{#each PLAYBACK_SPEEDS as speed}
{ e.stopPropagation(); setSpeed(speed); }} >{speed}x
{/each}
{/if}
{item.text}
{ e.stopPropagation(); renameItem(item); }} >Rename
{ e.stopPropagation(); copyItem(item); }} >Copy
{#if item.audioPath && item.segments && item.segments.length > 0}
{ e.stopPropagation(); openViewer(item); }} >Open viewer
{/if}
{ e.stopPropagation(); removeItem(item); }} >Delete
{/if}
{/each}
{/if}